tags:

views:

225

answers:

2

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'

+2  A: 

"-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.

Tom
I have already seen, that opencl spec doesn't discribe any"-g" option.It meens, that gDEBugger doesn't need any additional iformation for debugging of kerneles? Has somebody expirience with this tool? At the moment it doesn't work properly with my programs.
LonliLokli
A: 

"-g" is a feature, which is supported by ati-GPUs

LonliLokli