omp_init_allocator (GNU libgomp)

#### 3.13.1 `omp_init_allocator` – Create an allocator ¶

Description:

  Create an allocator that uses the specified memory space and has the specified traits; if an allocator that fulfills the requirements cannot be created, `omp_null_allocator` is returned.

  The predefined memory spaces and available traits can be found at Memory allocation, where the trait names have to be prefixed by `omp_atk_` (e.g. `omp_atk_pinned`) and the named trait values by `omp_atv_` (e.g. `omp_atv_true`); additionally, `omp_atv_default` may be used as trait value to specify that the default value should be used.

C/C++:

  Prototype: | `omp_allocator_handle_t omp_init_allocator(`
  | `omp_memspace_handle_t memspace,`
  | `int ntraits,`
  | `const omp_alloctrait_t traits[]);`

Fortran:

  Interface: | `function omp_init_allocator(memspace, ntraits, traits)`
  | `integer (omp_allocator_handle_kind) :: omp_init_allocator`
  | `integer (omp_memspace_handle_kind), intent(in) :: memspace`
  | `integer, intent(in) :: ntraits`
  | `type (omp_alloctrait), intent(in) :: traits(*)`

See also:

  Memory allocation, `OMP_ALLOCATOR` – Set the default allocator, `omp_destroy_allocator` – Destroy an allocator

Reference:

  OpenMP specification v5.0, Section 3.7.2