Utility class for asynchronously reading/writing between Rasters and device memory. More...
#include <DataStream.h>
Public Member Functions | |
RasterDataStream (isce3::io::Raster *raster, isce3::cuda::core::Stream stream, std::size_t buffer_size=0) | |
Constructor. More... | |
isce3::io::Raster * | raster () const |
Get pointer to Raster object. More... | |
void | set_raster (isce3::io::Raster *) |
Set raster. More... | |
isce3::cuda::core::Stream | stream () const |
Get associated CUDA stream object. More... | |
void | set_stream (isce3::cuda::core::Stream stream) |
Set CUDA stream. More... | |
std::size_t | buffer_size () const |
Get stream buffer size in bytes. More... | |
void | resize_buffer (std::size_t buffer_size) |
Set stream buffer size in bytes. More... | |
template<typename T > | |
void | load (T *dst, std::size_t col, std::size_t row, std::size_t width, std::size_t length) |
Read a block of data from the Raster and copy to the current device asynchronously. More... | |
template<typename T > | |
void | store (const T *src, std::size_t col, std::size_t row, std::size_t width, std::size_t length) |
Write a block of data from the current device to the Raster asynchronously. More... | |
Utility class for asynchronously reading/writing between Rasters and device memory.
|
inline |
Constructor.
[in] | raster | pointer to raster |
[in] | stream | CUDA stream |
[in] | buffer_size | stream buffer size in bytes |
|
inline |
Get stream buffer size in bytes.
|
inline |
Read a block of data from the Raster and copy to the current device asynchronously.
Reading from the Raster may overlap with operations in other CUDA streams. Copying to the device may overlap with operations on the host or in other CUDA streams.
The destination memory address must be in device-accessible memory.
[in] | dst | destination memory address |
[in] | col | index of first column to read |
[in] | row | index of first row to read |
[in] | width | number of columns to read |
[in] | length | number of rows to read |
|
inline |
Get pointer to Raster object.
|
inline |
Set stream buffer size in bytes.
|
inline |
Set raster.
|
inline |
Set CUDA stream.
|
inline |
Write a block of data from the current device to the Raster asynchronously.
Copying from the device may overlap with operations on the host or in other CUDA streams. Writing to the Raster may overlap with operations in other CUDA streams.
The source memory address must be in device-accessible memory.
[in] | src | source memory address |
[in] | col | index of first column to write |
[in] | row | index of first row to write |
[in] | width | number of columns to write |
[in] | length | number of rows to write |
|
inline |
Get associated CUDA stream object.