acc_on_device (GNU libgomp)

### 6.15 `acc_on_device` – Whether executing on a particular device ¶

Description:

  This function returns whether the program is executing on a particular device specified in devicetype. In C/C++ a non-zero value is returned to indicate the device is executing on the specified device type. In Fortran, `true` is returned. If the program is not executing on the specified device type C/C++ returns zero, while Fortran returns `false`.

  Note that in GCC, depending on devicetype, the function call might be folded to a constant in the compiler; compile with `-fno-builtin-acc_on_device` if a run-time function is desired.

C/C++:

  Prototype: | `acc_on_device(acc_device_t devicetype);`

Fortran:

  Interface: | `function acc_on_device(devicetype)`
  | `integer(acc_device_kind) devicetype`
  | `logical acc_on_device`

Reference:

  OpenACC specification v2.6, section 3.2.17.