Skip to content

CudaMirroredBuffer

#include <sbio/storage/cuda_device.hh>
struct CudaMirroredBuffer

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

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() const

Defined in src/lib/sbio/storage/cuda_device.hh:77


const inline

inline std::size_t size() const

Defined in src/lib/sbio/storage/cuda_device.hh:79


inline

inline void set_memory(void * ptr, std::size_t size)

Defined in src/lib/sbio/storage/cuda_device.hh:81


const inline

inline void * host_ptr() const

Defined in src/lib/sbio/storage/cuda_device.hh:89

A pinned replica of device memory buffer on the host.


inline

inline void set_host_memory(void * host_ptr)

Defined in src/lib/sbio/storage/cuda_device.hh:91


const inline

inline std::size_t host_stale() const

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


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.

Return Name Description
constexpr MemorySpace memory_space static inline constexpr

static inline constexpr

constexpr static inline constexpr MemorySpace memory_space()

Defined in src/lib/sbio/storage/cuda_device.hh:75

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


void * m_host_ptr { nullptr }

Defined in src/lib/sbio/storage/cuda_device.hh:113


std::size_t m_size { 0 }

Defined in src/lib/sbio/storage/cuda_device.hh:114


std::size_t m_host_stale { 0 }

Defined in src/lib/sbio/storage/cuda_device.hh:115