CL_PROGRAM_STRING_DEBUG_INFO

Macro to facilitate debugging Usage: Place mixin(CL_PROGRAM_STRING_DEBUG_INFO) on the line before the first line of your source. The first line ends with: CL_PROGRAM_STRING_BEGIN \" Each line thereafter of OpenCL C source must have a line end The last line is empty;

string
CL_PROGRAM_STRING_DEBUG_INFO
(
size_t line = __LINE__
,
string file = __FILE__
)

Examples

string code = mixin(CL_PROGRAM_STRING_DEBUG_INFO) ~ q{ kernel void foo( int a, float * b ) { // my comment *b[ get_global_id(0)] = a; } };

This should correctly set up the line, (column) and file information for your source string so you can do source level debugging.

Meta