Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
Public Member Functions | List of all members
arrow::gpu::CudaBufferReader Class Reference

File interface for zero-copy read from CUDA buffers. More...

#include <arrow/gpu/cuda_memory.h>

Inheritance diagram for arrow::gpu::CudaBufferReader:
arrow::io::BufferReader arrow::io::RandomAccessFile arrow::io::InputStream arrow::io::Seekable arrow::io::FileInterface arrow::io::Readable

Public Member Functions

 CudaBufferReader (const std::shared_ptr< CudaBuffer > &buffer)
 
 ~CudaBufferReader ()
 
Status Read (int64_t nbytes, int64_t *bytes_read, uint8_t *buffer) override
 Read bytes into pre-allocated host memory. More...
 
Status Read (int64_t nbytes, std::shared_ptr< Buffer > *out) override
 Zero-copy read from device memory. More...
 
- Public Member Functions inherited from arrow::io::BufferReader
 BufferReader (const std::shared_ptr< Buffer > &buffer)
 
 BufferReader (const uint8_t *data, int64_t size)
 
Status Close () override
 
Status Tell (int64_t *position) const override
 
Status Read (int64_t nbytes, int64_t *bytes_read, uint8_t *buffer) override
 
Status Read (int64_t nbytes, std::shared_ptr< Buffer > *out) override
 
Status ReadAt (int64_t position, int64_t nbytes, int64_t *bytes_read, uint8_t *out) override
 Read nbytes at position, provide default implementations using Read(...), but can be overridden. More...
 
Status ReadAt (int64_t position, int64_t nbytes, std::shared_ptr< Buffer > *out) override
 Default implementation is thread-safe. More...
 
Status GetSize (int64_t *size) override
 
Status Seek (int64_t position) override
 
bool supports_zero_copy () const override
 
std::shared_ptr< Bufferbuffer () const
 
- Public Member Functions inherited from arrow::io::RandomAccessFile
 ~RandomAccessFile () override
 Necessary because we hold a std::unique_ptr. More...
 
- Public Member Functions inherited from arrow::io::FileInterface
virtual ~FileInterface ()=0
 
FileMode::type mode () const
 
- Public Member Functions inherited from arrow::io::Readable
virtual ~Readable ()=default
 
- Public Member Functions inherited from arrow::io::Seekable
virtual ~Seekable ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from arrow::io::RandomAccessFile
 RandomAccessFile ()
 
- Protected Member Functions inherited from arrow::io::InputStream
 InputStream ()=default
 
- Protected Member Functions inherited from arrow::io::FileInterface
 FileInterface ()
 
void set_mode (FileMode::type mode)
 
- Protected Attributes inherited from arrow::io::BufferReader
std::shared_ptr< Bufferbuffer_
 
const uint8_t * data_
 
int64_t size_
 
int64_t position_
 
- Protected Attributes inherited from arrow::io::FileInterface
FileMode::type mode_
 

Detailed Description

File interface for zero-copy read from CUDA buffers.

Note: Reads return pointers to device memory. This means you must be careful using this interface with any Arrow code which may expect to be able to do anything other than pointer arithmetic on the returned buffers

Constructor & Destructor Documentation

◆ CudaBufferReader()

arrow::gpu::CudaBufferReader::CudaBufferReader ( const std::shared_ptr< CudaBuffer > &  buffer)
explicit

◆ ~CudaBufferReader()

arrow::gpu::CudaBufferReader::~CudaBufferReader ( )

Member Function Documentation

◆ Read() [1/2]

Status arrow::gpu::CudaBufferReader::Read ( int64_t  nbytes,
int64_t *  bytes_read,
uint8_t *  buffer 
)
overridevirtual

Read bytes into pre-allocated host memory.

Parameters
[in]nbytesnumber of bytes to read
[out]bytes_readactual number of bytes read
[out]bufferpre-allocated memory to write into

Implements arrow::io::Readable.

◆ Read() [2/2]

Status arrow::gpu::CudaBufferReader::Read ( int64_t  nbytes,
std::shared_ptr< Buffer > *  out 
)
overridevirtual

Zero-copy read from device memory.

Parameters
[in]nbytesnumber of bytes to read
[out]outa Buffer referencing device memory
Returns
Status

Implements arrow::io::Readable.


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