Struct CudaMallocAllocator¶
Defined in File CudaMallocAllocator.hpp
Struct Documentation¶
-
struct
umpire::alloc
::
CudaMallocAllocator
¶ Uses cudaMalloc and cudaFree to allocate and deallocate memory on NVIDIA GPUs.
Public Functions
-
void *
allocate
(std::size_t size)¶ Allocate bytes of memory using cudaMalloc.
- Return
Pointer to start of the allocation.
- Parameters
bytes
: Number of bytes to allocate.
- Exceptions
umpire::util::Exception
: if memory cannot be allocated.
-
void
deallocate
(void *ptr)¶ Deallocate memory using cudaFree.
- Parameters
ptr
: Address to deallocate.
- Exceptions
umpire::util::Exception
: if memory cannot be free’d.
-
void *