omp_get_num_devices (GNU libgomp)

#### 3.7.4 `omp_get_num_devices` – Number of target devices ¶

Description:

  Returns the number of available non-host devices.

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

  Note that in GCC the function is marked pure, i.e. as returning always the same number. When GCC was not configured to support offloading, it is replaced by zero; compile with `-fno-builtin-omp_get_num_devices` if a run-time function is desired.

C/C++:

  Prototype: | `int omp_get_num_devices(void);`

Fortran:

  Interface: | `integer function omp_get_num_devices()`

See also:

  `omp_get_initial_device` – Return device number of initial device

Reference:

  OpenMP specification v4.5, Section 3.2.31.