HOME
| OPENMP API Specification: Version 5.1 November 2020

3.8.3  omp_target_is_present

Summary The omp_target_is_present routine tests whether a host pointer refers to storage that is mapped to a given device.

Format

SVG-Viewer needed.

 

 
int omp_target_is_present(const void *ptr, int device_num);  

SVG-Viewer needed.

SVG-Viewer needed.

 

 
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  

SVG-Viewer needed.

Constraints on Arguments The value of ptr must be a valid host pointer or NULL (or C_NULL_PTR, for Fortran). The device_num argument must be greater than or equal to zero and less than or equal to the result of omp_get_num_devices().

Binding The binding task set for an omp_target_is_present region is the encountering task.

Effect The omp_target_is_present routine returns true if device_num refers to the host device or if ptr refers to storage that has corresponding storage in the device data environment of device device_num. Otherwise, the routine returns false.

Restrictions Restrictions to the omp_target_is_present routine are as follows.

Cross References