LLVM OpenMP 22.0.0git
|
Support OMP 6.0 target memory management Expected offload runtime entries. More...
Public Member Functions | |
void | init () |
Initialize interface with offload runtime. | |
int | get_mem_resources (int ndevs, const int *devs, int host, omp_memspace_handle_t memspace, int *resources) |
Obtain resource information from offload runtime. | |
void * | omp_alloc (size_t size, omp_allocator_handle_t allocator) |
Invoke offload runtime's memory allocation routine. | |
void | omp_free (void *ptr, omp_allocator_handle_t allocator) |
Invoke offload runtime's memory deallocation routine. |
Support OMP 6.0 target memory management Expected offload runtime entries.
Returns number of resources and list of unique resource IDs in "resouces". Runtime needs to invoke this twice to get the number of resources, allocate space for the resource IDs, and finally let offload runtime write resource IDs in "resources". int __tgt_get_mem_resources(int num_devices, const int *devices, int host_access, omp_memspace_handle_t memspace, int *resources);
Redirects omp_alloc call to offload runtime. void *__tgt_omp_alloc(size_t size, omp_allocator_handle_t allocator);
Redirects omp_free call to offload runtime. void __tgt_omp_free(void *ptr, omp_allocator_handle_t);
Definition at line 1301 of file kmp_alloc.cpp.
|
inline |
Obtain resource information from offload runtime.
We assume offload runtime backends maintain a list of unique resource IDS.
Definition at line 1322 of file kmp_alloc.cpp.
|
inline |
Initialize interface with offload runtime.
Definition at line 1313 of file kmp_alloc.cpp.
References KMP_DLSYM.
|
inline |
Invoke offload runtime's memory allocation routine.
Definition at line 1329 of file kmp_alloc.cpp.
References size.
|
inline |
Invoke offload runtime's memory deallocation routine.
Definition at line 1335 of file kmp_alloc.cpp.