3.6.5 omp_get_device_num – Return device number of current device

Description:

This function returns a device number that represents the device that the current thread is executing on. When called on the host, it returns the same value as returned by the omp_get_initial_device function as required since OpenMP 5.0.

C/C++
Prototype:int omp_get_device_num(void);
Fortran:
Interface:integer function omp_get_device_num()
See also:

omp_get_initial_device – Return device number of initial device

Reference:

OpenMP specification v5.0, Section 3.2.37.