omp_target_is_present (GNU libgomp)

#### 3.7.3 `omp_target_is_present` – Check whether storage is mapped ¶

Description:

  This routine tests whether storage, identified by the host pointer ptr is mapped to the device specified by device_num. If so, it returns a nonzero value and otherwise zero. In particular, it always returns zero for the null pointer and for invalid device numbers; for the host device, a nonzero value is returned for all non-null pointers.

  Running this routine in a `target` region except on the initial device is not supported.

C/C++

  Prototype: | `int omp_target_is_present(const void *ptr,`
  | `int device_num)`

Fortran:

  Interface: | `integer(c_int) function omp_target_is_present(ptr, &`
  | `device_num) bind(C)`
  | `use, intrinsic :: iso_c_binding, only: c_ptr, c_int`
  | `type(c_ptr), value :: ptr`
  | `integer(c_int), value :: device_num`

See also:

  `omp_get_mapped_ptr` – Return device pointer to a host pointer, `omp_target_associate_ptr` – Associate a device pointer with a host pointer, `omp_target_is_accessible` – Check whether memory is device accessible

Reference:

  OpenMP specification v5.1, Section 3.8.3