|
HAMR
The Heterogeneous Accelerator Memory Resource
|
Go to the documentation of this file. 1 #ifndef hamr_buffer_allocator_h
2 #define hamr_buffer_allocator_h
6 #include "hamr_config.h"
88 #
if defined(HAMR_ENABLE_CUDA)
94 #
if defined(HAMR_ENABLE_HIP)
98 #
if defined(HAMR_ENABLE_OPENMP)
107 #if defined(HAMR_ENABLE_CUDA)
109 #elif defined(HAMR_ENABLE_HIP)
111 #elif defined(HAMR_ENABLE_OPENMP)
121 #if defined(HAMR_ENABLE_CUDA)
123 #elif defined(HAMR_ENABLE_HIP)
125 #elif defined(HAMR_ENABLE_OPENMP)
@ same
propagate the current allocator
@ malloc
allocates memory with malloc
@ cuda_host
allocates memory with cudaMallocHost
HAMR_EXPORT int cpu_accessible(buffer_allocator alloc)
Definition: hamr_buffer_allocator.h:35
@ none
no allocator specified
const HAMR_EXPORT char * get_allocator_name(buffer_allocator alloc)
return the human readable name of the allocator
@ cuda_uva
allocates memory with cudaMallocManaged
@ openmp
allocates memory with OpenMP device offload API
HAMR_EXPORT int openmp_accessible(buffer_allocator alloc)
Definition: hamr_buffer_allocator.h:72
@ hip_uva
allocates memory with hipMallocManaged
HAMR_EXPORT buffer_allocator get_device_allocator()
get the allocator type most suitable for the current build configuration.
Definition: hamr_buffer_allocator.h:105
heterogeneous accelerator memory resource
Definition: hamr_buffer.h:40
HAMR_EXPORT buffer_allocator get_host_allocator()
get the allocator type most suitable for the current build configuration.
Definition: hamr_buffer_allocator.h:119
@ cuda
allocates memory with cudaMalloc
HAMR_EXPORT int cuda_accessible(buffer_allocator alloc)
Definition: hamr_buffer_allocator.h:47
HAMR_EXPORT int hip_accessible(buffer_allocator alloc)
Definition: hamr_buffer_allocator.h:60
@ cuda_async
allocates memory with cudaMallocAsync
HAMR_EXPORT void assert_valid_allocator(buffer_allocator alloc)
asserts that the passed value is one of the known allocators
Definition: hamr_buffer_allocator.h:83
@ hip
allocates memory with hipMalloc
buffer_allocator
allocator types that may be used with hamr::buffer
Definition: hamr_buffer_allocator.h:13
@ cpp
allocates memory with new