Target Clauses
The following clauses are commonly used with the OpenMP target construct:
device(dev_id)
The device clause defines which device the offload region should be executed on. The dev_id is an integer that identifies the target device. If none is provided, the default device is used, which is typically device 0 unless overridden by the environment variable OMP_DEFAULT_DEVICE.
if(condition)
The if clause accepts a scalar expression (an integer expression in C/C++, or a logical expression in Fortran). If the expression evaluates to false, the target region falls back to executing on the host.
map(map-type: var)
The map clause controls resource allocation and data transfer between host and device. It can specify which variables to transfer and in which direction. The map-types are to, from, tofrom (default), and alloc. The host copy of the variable is called the original variable and the device copy is called the corresponding variable. This clause is covered extensively in the Data Management topic of this roadmap.
nowait
The nowait clause makes the offload to the device asynchronous. This clause is covered more in the Advanced Techniques topic of this roadmap.
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)