isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
isce3::cuda::io::FileDataStream Class Reference

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...
 

Detailed Description

Utility class for asynchronously reading/writing between files and device memory.

Constructor & Destructor Documentation

isce3::cuda::io::FileDataStream::FileDataStream ( const std::string &  filename,
isce3::cuda::core::Stream  stream,
std::size_t  buffer_size = 0 
)
inline

Constructor.

Parameters
[in]filenamepath to file
[in]streamCUDA stream
[in]buffer_sizestream buffer size in bytes

Member Function Documentation

std::size_t isce3::cuda::io::FileDataStream::buffer_size ( ) const
inline

Get stream buffer size in bytes.

const std::string & isce3::cuda::io::FileDataStream::filename ( ) const
inline

Get path to file.

void isce3::cuda::io::FileDataStream::load ( void *  dst,
std::size_t  offset,
std::size_t  count 
)
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.

Parameters
[in]dstdestination memory address
[in]offsetposition of first character in file to read
[in]countsize in bytes to read
void isce3::cuda::io::FileDataStream::resize_buffer ( std::size_t  buffer_size)
inline

Set stream buffer size in bytes.

void isce3::cuda::io::FileDataStream::set_filename ( const std::string &  filename)
inline

Set path to file.

void isce3::cuda::io::FileDataStream::set_stream ( isce3::cuda::core::Stream  stream)
inline

Set CUDA stream.

void isce3::cuda::io::FileDataStream::store ( const void *  src,
std::size_t  offset,
std::size_t  count 
)
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.

Parameters
[in]srcsource memory address
[in]offsetposition to write first character in file
[in]countsize in bytes to write
isce3::cuda::core::Stream isce3::cuda::io::FileDataStream::stream ( ) const
inline

Get associated CUDA stream object.


The documentation for this class was generated from the following files:

Generated for ISCE3.0 by doxygen 1.8.5.