omp_get_default_device (GNU libgomp)

#### 3.7.3 `omp_get_default_device` – Get the default device for target regions ¶

Description:

  Get the value of the default-device-var ICV, which is used for target regions without a device clause. The value is either a nonnegative device number, `omp_initial_device` or `omp_invalid_device`. Note that for the host, the ICV can have two values: either the value of the named constant `omp_initial_device` or the value returned by the `omp_get_num_devices` routine.

  The effect of running this routine in a `target` region is unspecified.

C/C++:

  Prototype: | `int omp_get_default_device(void);`

Fortran:

  Interface: | `integer function omp_get_default_device()`

See also:

  `OMP_DEFAULT_DEVICE` – Set the device used in target regions, `omp_set_default_device` – Set the default device for target regions, `omp_get_initial_device` – Return device number of initial device

Reference:

  OpenMP specification v4.5, Section 3.2.30.