Intel® Advisor Help

Set Up Environment to Analyze DPC++, OpenMP*, and OpenCL™ Applications

If you have an application that contains Data Parallel C++ (DPC++), 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. In this approach, your code is temporarily offloaded to a CPU so that you can profile it and model its performance with the Offload Modeling perspective.

Important

CPU offload is only required to analyze DPC++, C++/Fortran with OpenMP target, or OpenCL code with the Offload Modeling perspective. GPU Roofline analyzes code running on a GPU and requires you to configure your system properly instead.

Depending on your operating system, do one of the following:

On Linux* OS

  1. For DPC++ code: Force offloading to a CPU using one of the following:
    • Recommended: Set the SYCL_DEVICE_FILTER environment variable as follows:
      export SYCL_DEVICE_FILTER=opencl:cpu
    • If your application uses a SYCL device selector:
      1. In the application source code, add the following to specify the CPU as the target device:
        sycl::cpu_selector

        For details, see Device selector in the DPC++ Reference.

      2. Rebuild the application,
  2. 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
  3. 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.

On Windows* OS

  1. Set the following environment variable to use the JIT profiling API:
    set INTEL_JIT_BACKWARD_COMPATIBILITY=1
  2. For DPC++ code: Force offloading to a CPU using one of the following:
    • Recommended: Set the SYCL_DEVICE_FILTER environment variable as follows:
      set SYCL_DEVICE_FILTER=opencl:cpu
    • If your application uses a SYCL device selector:
      1. In the application source code, add the following to specify the CPU as the target device:
        sycl::cpu_selector

        For details, see Device selector in the DPC++ Reference.

      2. Rebuild the application,
  3. 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
  4. 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