1
votes

I'm using the Intel SDK for OpenCL with an Intel HD Graphics 4000 GPU to successfully run an OpenCL program. I've made sure to link against the Intel OpenCL libraries since I also have Nvidia libraries installed.

However, putting a printf() call in the kernel gives the OpenCL compiler error

error: implicit declaration of function 'printf' is not allowed in OpenCL

Also, I've enabled OpenCL kernel debugging in the Visual Studio 2012 plugin, and passed the following options to clBuildProgram:

"-g -s C:\\Path\\to\\my\\program.cl"

However, kernel breakpoints are skipped. Hovering over the breakpoint gives the message:

The breakpoint will not currently be hit. No symbols have been loaded for this document.

My kernels are in a separate .cl file, and I'm setting the breakpoints the way I would for C/C++ code. Is this the correct way to set breakpoints using the Intel SDK for OpenCL debugger?

Why are printf() calls and breakpoints not working with the Intel SDK for OpenCL?

1
Did you enable printf by adding #pragma OPENCL EXTENSION cl_intel_printf : enable somewhere before the statement? - Matthias Holzapfel
@MatthiasHolzapfel Yes, I tried that. - 1''
Hi, I am having the same issue what you faced earlier. I am not able to Debug my Kernel and the Breakpoints are not being hit. I am using Intel OpenCL SDK 2014 with Visual Studio 2010. If you have found the Solution, would grateful if you can share the Solution - Steve

1 Answers

2
votes

THe function printf() was introduced in the OCL version 1.2. Intel released this version not that long time ago. I'd bet that you still have the 1.1 version.

Regarding the debugger I almost never used it but based on this document the path is supposed to be given like that:

"-g -s \"C:\\Path\\to\\my\\program.cl\""

You are also supposed to choose which thread you wanna debug.