Struct AmPinnedAllocator

Struct Documentation

struct AmPinnedAllocator

Uses hcAlloc and hcAlloc to allocate and deallocate memory on AMD GPUs that support ROCm.

Public Functions

void *allocate(std::size_t bytes)

Allocate bytes of pinned memory using am_alloc.

Return

Pointer to start of the allocation.

Parameters
  • bytes: Number of bytes to allocate.

Exceptions

void deallocate(void *ptr)

Deallocate memory using am_free.

Parameters
  • ptr: Address to deallocate.

Exceptions