Utility class for asynchronously reading/writing between files and device memory. More...
#include <DataStream.h>
Public Member Functions | |
FileDataStream (const std::string &filename, isce3::cuda::core::Stream stream, std::size_t buffer_size=0) | |
Constructor. More... | |
const std::string & | filename () const |
Get path to file. More... | |
void | set_filename (const std::string &) |
Set path to file. 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... | |
void | load (void *dst, std::size_t offset, std::size_t count) |
Read data and copy to the current device asynchronously. More... | |
void | store (const void *src, std::size_t offset, std::size_t count) |
Write data from the current device to the file asynchronously. More... | |
Utility class for asynchronously reading/writing between files and device memory.
|
inline |
Constructor.
[in] | filename | path to file |
[in] | stream | CUDA stream |
[in] | buffer_size | stream buffer size in bytes |
|
inline |
Get stream buffer size in bytes.
|
inline |
Get path to file.
|
inline |
Read data and copy to the current device asynchronously.
Reading from the file 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] | offset | position of first character in file to read |
[in] | count | size in bytes to read |
|
inline |
Set stream buffer size in bytes.
|
inline |
Set path to file.
|
inline |
Set CUDA stream.
|
inline |
Write data from the current device to the file asynchronously.
Copying from the device may overlap with operations on the host or in other CUDA streams. Writing to the file may overlap with operations in other CUDA streams.
The source memory address must be in device-accessible memory.
[in] | src | source memory address |
[in] | offset | position to write first character in file |
[in] | count | size in bytes to write |
|
inline |
Get associated CUDA stream object.