CUDABuffer

A class that encapsulates the CUDA memory allocation/deallocation process.

Members

Functions

get
void get(void[] buf)

Copies data from the device to the host.

numBytes
size_t numBytes()

Provides the size of the buffer allocated on the CUDA device.

ptr
inout(CUdeviceptr) ptr()

Provides the device pointer.

set
void set(const void[] buf)

Copies data from the host to the device.

Static functions

create
CUDABuffer create(size_t numBytes)

Constructs a CUDABuffer object and allocates memory on the CUDA device.

destroy
void destroy(CUDABuffer buf)

Releases the CUDA resources used by buf internally.

Meta