Struct CudaMallocManagedAllocator

Struct Documentation

struct CudaMallocManagedAllocator

Uses cudaMallocManaged and cudaFree to allocate and deallocate unified memory on NVIDIA GPUs.

Public Functions

void *allocate(std::size_t bytes)

Allocate bytes of memory using cudaMallocManaged.

Return

Pointer to start of the allocation.

Parameters
  • bytes: Number of bytes to allocate.

Exceptions

void deallocate(void *ptr)

Deallocate memory using cudaFree.

Parameters
  • ptr: Address to deallocate.

Exceptions