Template Struct MemoryPinner

Struct Documentation

template<typename T>
struct MemoryPinner

Memory pinner for an std::vector.

Pin memory (lock the memory page) allocated by an std::vector to RAM and allocate its associated memory on GPU.

Public Functions

inline MemoryPinner(std::vector<T> &src)

Constructor.

inline void CopyToDevice()

Copy data to GPU.

inline void CopyFromDevice()

Copy data from GPU.

inline T *GetDevicePtr()

Get pointer to device memory.

Protected Attributes

crb::MemoryPinningManager<T> pinned_host_
crb::DeviceMemory<T> device_