Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference
A newer version of this document is available. Customers should click here to go to the newest version.
fopenmp-targets, Qopenmp-targets
Enables offloading to a specified GPU target if OpenMP* features have been enabled.
| Linux: | -fopenmp-targets=triple | 
| Windows: | /Qopenmp-targets:triple | 
| triple | Is a target triple device name. The following triplets are supported. 
 For example, when you specify spir64, the compiler generates an x86 + SPIR64 (64-bit Standard Portable Intermediate Representation) fat binary for Intel® GPU devices. | 
| OFF | If this option is not specified, no fat binaries are created. | 
This option enables offloading to a specified GPU target if OpenMP* features have been enabled.
To use this option, you must enable recognition of OpenMP* features by specifying one of the following options:
Linux
- -qopenmp 
- -fiopenmp 
- -fopenmp (deprecated; it is equivalent to -qopenmp) 
Windows
- /Qopenmp 
- /Qiopenmp 
The following shows an example:
icx (or icpx) -fiopenmp -fopenmp-targets=spir64 matmul_offload.cpp -o matmul
When you specify -fopenmp-targets or /Qopenmp-targets, C++ exception handling is disabled for target compilations.
Linux
For host compilations, if you want to disable C++ exception handling, you must specify option -fno-exceptions.
When OpenMP* offloading is enabled, this option only applies to device-specific compilation.
Visual Studio: DPC++ > Language > Enable OpenMP Offloading
C/C++ > Language [Intel C++] > Enable OpenMP Offloading
Intel(R) oneAPI DPC++ Compiler > Language > Enable OpenMP Offloading
Intel C++ Compiler > Language > Enable OpenMP Offloading
Eclipse: Intel(R) oneAPI DPC++ Compiler > Language > Enable OpenMP Offloading
Intel C++ Compiler > Language > Enable OpenMP Offloading
None