Intel® C++ Compiler 18.0 Developer Guide and Reference
This topic only applies when targeting Intel® Graphics Technology.
You can write code that should not be built when the target is a CPU-only executable.
By default, the compiler defines the macro __INTEL_OFFLOAD. You can write code within an #ifdef __INTEL_OFFLOAD section when the source code is customized for running on the target.
For example, you can use this macro to check that the code was built with the negative form of the [Q]offload compiler option.
The section for the host compiler works only when you compile with the negative form of the Qoffload compiler option.
#ifdef __INTEL_OFFLOAD
cout << "\nThis program is built with __INTEL_OFFLOAD.\n"
<< "The target(gfx) code will be executed on target if it is available\n";
#else
cout << "\nThis program is built without __INTEL_OFFLOAD\n";
<< "The target(gfx) code will be executed on CPU only.\n";
#endif
This code can only be used in the host code because code for Intel® Graphics Technology does not support this kind of I/O.