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.
Offload your SYCL, C++/Fortran with OpenMP target, or OpenCL code to CPU
only
to analyze it with the CPU-to-GPU
Offload Modeling
workflow. To analyze it with the
GPU-to-GPU Offload Modeling workflow
or
GPU Roofline
workflow,
configure your system to analyze GPU kernels instead.
Depending on your operating system, do one of the following:
Linux* OS
- ForSYCL code: Force offloading to a CPU using one of the following:
- Recommended: Set theSYCL_DEVICE_FILTERenvironment variable as follows:export SYCL_DEVICE_FILTER=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_selectorFor details, see Device selectors in the SYCL Reference.
- Rebuild the application,
- ForOpenMP 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=MANDATORYexport LIBOMPTARGET_DEVICETYPE=CPUexport LIBOMPTARGET_PLUGIN=OPENCL
- To run code natively on CPU, set the following variable:export OMP_TARGET_OFFLOAD=DISABLED
- If your application usesOpenCL 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
- ForSYCL code: Force offloading to a CPU using one of the following:
- Recommended: Set theSYCL_DEVICE_FILTERenvironment variable as follows:set SYCL_DEVICE_FILTER=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_selectorFor details, see Device selectors in the SYCL Reference.
- Rebuild the application,
- ForOpenMP 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=MANDATORYset LIBOMPTARGET_DEVICETYPE=CPUset LIBOMPTARGET_PLUGIN=OPENCL
- To run code natively on CPU, set the following variable:set OMP_TARGET_OFFLOAD=DISABLED
- If your application usesOpenCL 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.