Compile OpenCL kernels with debug information?
Question
How can I compile opencl kernels with debug information? If i do it like hear debugging
[const char* options = "-g";
clBuildProgram( *hProgram, 0, 0, options,NULL,NULL);]:
i get following error:
clang: Unknown command line argument '-g'. Try: 'clang --help'
Solution
"-g" is not a supported build option in OpenCL, see section 5.4.3/5.6.3 (version 1.0/1.1 respectively) of the specification for a list of the supported options.
If you're targetting a CPU then "-g" may work but is unsupported. For debugging on GPUs you could check out gDEBugger CL perhaps, I've not tried it though. NVIDIA's Parallel Nsight (formerly codenamed Nexus) has OpenCL profiling features in the beta and will support OpenCL debugging.
OTHER TIPS
"-g" is a feature, which is supported by ati-GPUs