3 #include <isce3/cuda/core/Event.h>
4 #include <isce3/cuda/core/Stream.h>
5 #include <isce3/io/Raster.h>
7 #include <thrust/host_vector.h>
8 #include <thrust/system/cuda/experimental/pinned_allocator.h>
10 namespace isce3 {
namespace cuda {
namespace io {
14 using pinned_host_vector = thrust::host_vector<T,
15 thrust::system::cuda::experimental::pinned_allocator<T>>;
30 void CUDART_CB cb_write(cudaStream_t, cudaError_t,
void * obj);
35 const std::string * filename;
59 void CUDART_CB cb_setBlock(cudaStream_t, cudaError_t,
void * obj);
95 const std::string &
filename()
const;
125 void load(
void * dst, std::size_t offset, std::size_t count);
140 void store(
const void * src, std::size_t offset, std::size_t count);
143 std::string _filename;
146 pinned_host_vector<char> _buffer;
227 void store(
const T * src,
237 pinned_host_vector<char> _buffer;
243 #define ISCE_CUDA_IO_DATASTREAM_ICC
244 #include "DataStream.icc"
245 #undef ISCE_CUDA_IO_DATASTREAM_ICC
Definition: DataStream.h:44
isce3::cuda::core::Stream stream() const
Get associated CUDA stream object.
Definition: DataStream.icc:226
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.
Definition: DataStream.icc:285
Utility class for asynchronously reading/writing between files and device memory. ...
Definition: DataStream.h:79
isce3::cuda::core::Stream stream() const
Get associated CUDA stream object.
Definition: DataStream.icc:108
std::size_t buffer_size() const
Get stream buffer size in bytes.
Definition: DataStream.icc:241
void set_stream(isce3::cuda::core::Stream stream)
Set CUDA stream.
Definition: DataStream.icc:114
void set_stream(isce3::cuda::core::Stream stream)
Set CUDA stream.
Definition: DataStream.icc:232
void set_filename(const std::string &)
Set path to file.
Definition: DataStream.icc:99
Definition: DataStream.h:18
Utility class for asynchronously reading/writing between Rasters and device memory.
Definition: DataStream.h:154
void load(void *dst, std::size_t offset, std::size_t count)
Read data and copy to the current device asynchronously.
Definition: DataStream.icc:138
void store(const void *src, std::size_t offset, std::size_t count)
Write data from the current device to the file asynchronously.
Definition: DataStream.icc:173
Thin RAII wrapper around cudaEvent_t.
Definition: Event.h:8
isce3::io::Raster * raster() const
Get pointer to Raster object.
Definition: DataStream.icc:211
void resize_buffer(std::size_t buffer_size)
Set stream buffer size in bytes.
Definition: DataStream.icc:129
const std::string & filename() const
Get path to file.
Definition: DataStream.icc:93
std::size_t buffer_size() const
Get stream buffer size in bytes.
Definition: DataStream.icc:123
void set_raster(isce3::io::Raster *)
Set raster.
Definition: DataStream.icc:217
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.
Definition: DataStream.icc:257
void resize_buffer(std::size_t buffer_size)
Set stream buffer size in bytes.
Definition: DataStream.icc:247
Data structure meant to handle Raster I/O operations.
Definition: Raster.h:34
Thin RAII wrapper around cudaStream_t.
Definition: Stream.h:10