a reader capable of producing views over device memory. More...
#include <data_chunk_source.hpp>
Public Member Functions | |
virtual void | skip_bytes (std::size_t size)=0 |
Skips the specified number of bytes in the data source. More... | |
virtual std::unique_ptr< device_data_chunk > | get_next_chunk (std::size_t size, rmm::cuda_stream_view stream)=0 |
Get the next chunk of bytes from the data source. More... | |
a reader capable of producing views over device memory.
The data chunk reader API encapsulates the idea of statefully traversing and loading a data source. A data source may be a file, a region of device memory, or a region of host memory. Reading data from these data sources efficiently requires different strategies depending on the type of data source, type of compression, capabilities of the host and device, the data's destination. Whole-file decompression should be hidden behind this interface.
Definition at line 76 of file data_chunk_source.hpp.
|
pure virtual |
Get the next chunk of bytes from the data source.
Performs any necessary work to read and prepare the underlying data source for consumption as a view over device memory. Common implementations may read from a file, copy data from host memory, allocate temporary memory, perform iterative decompression, or even launch device kernels.
size | number of bytes to read |
stream | stream to associate allocations or perform work required to obtain chunk |
size
bytes. May return less than size
bytes if reader reaches end of underlying data source. Returned data must be accessed in stream order relative to the specified stream
|
pure virtual |
Skips the specified number of bytes in the data source.
size | The number of bytes to skip |