Visible to Intel only — GUID: GUID-133EA31E-378D-431D-8F17-D4C48AC24E41
Visible to Intel only — GUID: GUID-133EA31E-378D-431D-8F17-D4C48AC24E41
Set Up Environment to Offload SYCL, OpenMP* target, and OpenCL™ Applications to CPU
If you have an application that contains SYCL, C++/Fortran with OpenMP* target, or OpenCL™ code and prepared for offloading to a target device, you can analyze and model its potential performance on a different target device with the it with the Intel® Advisor.
To do this, use CPU offload profiling to offload your code temporarily to a CPU so that you can profile it and model its performance with the Offload Modeling perspective.
Depending on your operating system, do one of the following:
Linux* OS
- For SYCL code: Force offloading to a CPU using one of the following:
- Recommended: Set the ONEAPI_DEVICE_SELECTOR environment variable as follows:
export ONEAPI_DEVICE_SELECTOR=opencl:cpu
- If your application uses a SYCL device selector:
- In the application source code, add the following to specify the CPU as the target device:
sycl::cpu_selector_v
For details, see Device selectors in the SYCL Reference.
- Rebuild the application,
- In the application source code, add the following to specify the CPU as the target device:
- Recommended: Set the ONEAPI_DEVICE_SELECTOR environment variable as follows:
- For OpenMP code: Force offloading to a CPU with one of the following:
- Recommended: To offload code to CPU, set the following environment variables:
export OMP_TARGET_OFFLOAD=MANDATORY
export LIBOMPTARGET_DEVICETYPE=CPU
export LIBOMPTARGET_PLUGIN=OPENCL
- To run code natively on CPU, set the following variable:
export OMP_TARGET_OFFLOAD=DISABLED
- Recommended: To offload code to CPU, set the following environment variables:
- If your application uses OpenCL code: Configure your code to be offloaded to a CPU. Refer to the OpenCL documentation at https://www.khronos.org/registry/OpenCL/ for specific instructions.
Windows* OS
- Set the following environment variable to use the JIT profiling API:
set INTEL_JIT_BACKWARD_COMPATIBILITY=1
- For SYCL code: Force offloading to a CPU using one of the following:
- Recommended: Set the ONEAPI_DEVICE_SELECTOR environment variable as follows:
set ONEAPI_DEVICE_SELECTOR=opencl:cpu
- If your application uses a SYCL device selector:
- In the application source code, add the following to specify the CPU as the target device:
sycl::cpu_selector_v
For details, see Device selectors in the SYCL Reference.
- Rebuild the application,
- In the application source code, add the following to specify the CPU as the target device:
- Recommended: Set the ONEAPI_DEVICE_SELECTOR environment variable as follows:
- For OpenMP code: Force offloading to a CPU with one of the following:
- Recommended: To offload code to CPU, set the following environment variables:
set OMP_TARGET_OFFLOAD=MANDATORY
set LIBOMPTARGET_DEVICETYPE=CPU
set LIBOMPTARGET_PLUGIN=OPENCL
- To run code natively on CPU, set the following variable:
set OMP_TARGET_OFFLOAD=DISABLED
- Recommended: To offload code to CPU, set the following environment variables:
- If your application uses OpenCL code: Configure your code to be offloaded to a CPU. Refer to the OpenCL documentation at https://www.khronos.org/registry/OpenCL/ for specific instructions.
Next Steps
- Set up a project if you do not have one and run the Intel Advisorfrom a graphical user interface.
- Run the Intel Advisor from a graphical user interface and set up a project if you do not have one.