CudaMirroredBuffer
CudaMirroredBuffer
Section titled “CudaMirroredBuffer”#include <sbio/storage/cuda_device.hh>struct CudaMirroredBufferDefined in src/lib/sbio/storage/cuda_device.hh:74
A GPU device buffer with a pinner replica on the host.
This buffer is intended to be used for staged IO. [ptr()](#ptr-1) gives access to the “real” buffer livingin device memory. IO can write to [host_ptr()](#host_ptr) which is the replica on the host, however.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
void * |
ptr const inline |
|
std::size_t |
size const inline |
|
void |
set_memory inline |
|
void * |
host_ptr const inline |
A pinned replica of device memory buffer on the host. |
void |
set_host_memory inline |
|
std::size_t |
host_stale const inline |
The number of bytes from start of buffer that need to be copied to host. |
void |
set_host_stale inline |
Indicate how many bytes need to be copied into the host replica. |
const inline
inline void * ptr() constDefined in src/lib/sbio/storage/cuda_device.hh:77
const inline
inline std::size_t size() constDefined in src/lib/sbio/storage/cuda_device.hh:79
set_memory
Section titled “set_memory”inline
inline void set_memory(void * ptr, std::size_t size)Defined in src/lib/sbio/storage/cuda_device.hh:81
host_ptr
Section titled “host_ptr”const inline
inline void * host_ptr() constDefined in src/lib/sbio/storage/cuda_device.hh:89
A pinned replica of device memory buffer on the host.
set_host_memory
Section titled “set_host_memory”inline
inline void set_host_memory(void * host_ptr)Defined in src/lib/sbio/storage/cuda_device.hh:91
host_stale
Section titled “host_stale”const inline
inline std::size_t host_stale() constDefined in src/lib/sbio/storage/cuda_device.hh:100
The number of bytes from start of buffer that need to be copied to host.
When the data is written to the GPU buffer directly, the host-side replica should be marked as stale by indicating the number of new bytes to copy over.
set_host_stale
Section titled “set_host_stale”inline
inline void set_host_stale(std::size_t nbytes)Defined in src/lib/sbio/storage/cuda_device.hh:109
Indicate how many bytes need to be copied into the host replica.
When the data is written to the GPU buffer directly, the host-side replica should be marked as stale by indicating the number of new bytes to copy over.
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
constexpr MemorySpace |
memory_space static inline constexpr |
memory_space
Section titled “memory_space”static inline constexpr
constexpr static inline constexpr MemorySpace memory_space()Defined in src/lib/sbio/storage/cuda_device.hh:75
Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
void * |
m_ptr |
|
void * |
m_host_ptr |
|
std::size_t |
m_size |
|
std::size_t |
m_host_stale |
void * m_ptr { nullptr }Defined in src/lib/sbio/storage/cuda_device.hh:112
m_host_ptr
Section titled “m_host_ptr”void * m_host_ptr { nullptr }Defined in src/lib/sbio/storage/cuda_device.hh:113
m_size
Section titled “m_size”std::size_t m_size { 0 }Defined in src/lib/sbio/storage/cuda_device.hh:114
m_host_stale
Section titled “m_host_stale”std::size_t m_host_stale { 0 }Defined in src/lib/sbio/storage/cuda_device.hh:115