Enabling Debugging in OpenCL™ CPU Compiler and Runtime
To enable the debugging mode in the OpenCL™ CPU Compiler and Runtime,
specific options should be passed to the build options string parameter
in the
clBuildProgram
function:- -gflag enables source-level debug information generation.NotePassing a-gflag means that no optimizations (such as inlining, unrolling, vectorization) are performed, the same as if a-cl-opt-disableoption was passed.
- -s /full/path/to/OpenCL/source/file.cloption specifies the full path to the OpenCL™ source file. If the path includes spaces, the entire path should be enclosed with double or single quotes. This option is required in cases where the source of an OpenCL™ kernel is passed to theclCreateProgramWithSourcefunction as a string. Only one file can be specified with the-soption. If the file contains one or more#includedirectives, multiple paths for files with the-soption are not needed.