Loading...
Searching...
No Matches
kmp_tgt_allocator_t Class Reference

## 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)
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.

## Detailed Description

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.

## Member Function Documentation

## get_mem_resources()

int kmp_tgt_allocator_t::get_mem_resources | ( | int | ndevs,
|  | const int * | devs,
|  | int | host,
|  | omp_memspace_handle_t | memspace,
|  | int * | resources )

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.

The documentation for this class was generated from the following file:

- kmp_alloc.cpp