In this step, you will compile the same code into an application that runs only on the host. You can use this step to compile an early version of your code, where the offload language extensions are ignored by the compiler, to ensure that the application runs correctly on just the host only. Once your application runs correctly on the host, you can compile the same code into an application that runs on both the host and target.
Compile the source code using the following command:
icc -openmp -no-offload tbo_sort.c -o tbo_exe_CPU
The no-offload option sets the compiler to ignore the offload language extensions and not define the __INTEL_OFFLOAD macro. The #ifdef pragma contains the code block to detect the target and other target specific directives.
Run the application using the following command.
./tbo_exe_CPU
Just as before, the application displays the first 20 values in ascending order and the first ten even, odd, and prime numbers. However, this version does not display the quantity of targets because the compiler ignored the code block for the #ifdef pragma with the __INTEL_OFFLOAD macro.
This step is the last step in the tutorial.