Intel® Inspector Help
Use Intel® Inspector to analyze applications containing offloaded code and detect code issues before kernels start executing on GPU.
Correctness analysis is more complicated when offloading Data Parallel C++ (DPC++), OpenMP* and Fortran code to an accelerator. Intel® Inspector introduces the early interception approach that enables you to intercept some problems before the kernel executes on a target device.
Intel® Inspector performs dynamic analysis of generated or linked code and inspects third-party libraries, even when source code is not available. Before running the analysis, make sure to configure your application to run on CPU. You can do that in the following ways:
export SYCL_DEVICE_FILTER="opencl:cpu"
export SYCL_DEVICE_TYPE=CPU
export OMP_TARGET_OFFLOAD=MANDATORY
export LIBOMPTARGET_DEVICETYPE=cpu
Verify that your application executes code you want to analyze without crashes or exceptions.
Intel® Inspector enables you to run three predefined types of both Memory and Threading analyses. The higher level you select, the more memory and execution overhead the analysis takes.
Run Analysis Using GUI
To run memory or threading analysis using GUI:
Run Analysis Using CLI
To run memory or threading analysis for applications with offloaded code using CLI, run the following command:
inspxe-cl -collect <analysis_type> -knob offload-target=cpu -- <MyApp> [app_args]
where <analysis_type> value specifies the predefined analysis type you want to execute. Available values:
To export results into a my_problems.xml file in your current working directory, run the following command:
For details about inspxe-cl command line interface, see inspxe-cl Actions, Options and Arguments or run the inspxe-cl -help command.
Open the collected results in the GUI and analyze the detected errors. For offloaded code, the list of problems that Intel® Inspector can detect in addition to CPU problems is as follows:
Intel® Inspector enables you to open your source code and highlight problematic code lines.
View examples for a memory problem and a threading problem.