Visible to Intel only — GUID: GUID-2369F3AC-A517-4C7A-BA37-814661460EC1
Visible to Intel only — GUID: GUID-2369F3AC-A517-4C7A-BA37-814661460EC1
omp target variant dispatch
Conditionally calls a procedure offload variant if the specified device is available; otherwise, executes the procedure on the host.
#pragma omp target variant dispatch {device(integer-expression) | nowait | subdevice([integer-constant ,] integer-expression [ : integer-expression [ : integer-expression] ] ) | use_device_pointer (ptr-list)} |
device |
Tells the compiler to call the variant only if device n is available. |
subdevice |
Tells the compiler to call the variant only if the specified tiles or compute slices are available. |
nowait |
Tells the compiler that calls to the procedure can occur asynchronously. If nowait is not specified, calls occur synchronously. |
use_device_ptr |
Tells the compiler to use the corresponding device pointer instead of the host pointer when the variant procedure is called. |
If both device and subdevice are specified, the variant is called only if the specified tiles or compute slices are available on device n. Otherwise, the base version of the procedure is called on the host.
The omp target variant dispatch pragma causes the compiler to emit conditional dispatch code around the associated procedure call that follows the pragma. If the specified device is available, the variant version is called.
The name of the procedure associated with the omp target variant dispatch pragma must have appeared in an omp declare variant pragma in the specification part of the calling scope. The interface of the variant procedure must be accessible in the base procedure where omp target variant dispatch appears.
The omp target variant dispatch pragma is supported in host code only.
Use pragma omp target variant dispatch when calling Intel® oneAPI Math Kernel Library (oneMKL).
In other cases, we recommend you use the OpenMP* pragma omp dispatch. For more information about pragma omp dispatch, see the OpenMP* documentation.