Debugging OpenCL with Intel Visual Studio SDK does not stop at breakpoints

I want to debug my OpenCL code through Intel SDK and visual studio 2013, but the debugger doesn't stop at breakpoints. I enabled OpenCL Kernel debugging and set buildoption to -g -s and added a breakpoint in opencl code (I am not using any offset either).

I have also tried all the voodoo mentioned elsewhere including.

  • Setting a breakpoint on (/ behind) context creation. *
  • Using only an instance of Visual Studio at the same time
  • spit three times on the left shoulder before starting debugging
  • ...

but nothing worked. Any suggestions?

* This results in the following: Until the breakpoint is reached, OCL breakpoints are marked as unavailable, and they are subsequently displayed with a file and a line of code.

+3


source to share


3 answers


What device are you using for debugging? Only Intel processor is allowed for debugging with the Intel SDK. Intel won't work.

Check the following: Are you using the Intel compiler instead of the MSVC compiler? right click on the project -> convert to opencl project / use intel c ++ compiler

Compiler settings: Code_builder menue -> opencl debugger -> options

check "enable opencl kernel debugging" specify the work item you want to debug (0,0,0 is fine and the frist thread if you are only using the global workgrp size and not local)

debugger api tab: check enable opencl api debugger

after -g -s you must add the path to the kernel, for example:



options = " -g -s E:\\prog\\clproj\\Clproj\\kernel.cl";

      

Have you passed char * options to clBuildProgram like this?

clBuildProgram(program, 0, NULL, options, NULL, NULL);

      

Make sure you are using intel opencl libraries and not any other opencl libs.

For proper setup with Vstudio see here:

intel manual

+4


source


I have the same problem when trying to debug OpenCL kernels using mixed platforms (C # with C | C ++). When my test project is a C # project that calls native C | C ++ (it contains the OpenCL code), Intel OpenCL debugger has been disabled. I have not been able to get it to work on mixed platforms.



The workaround was to get rid of the C # project and only use native code. This is fine for unit testing, but you can imagine that OpenCL code should be integrated into a system developed primarily in C #. To date, I have not found a working solution for debugging OpenCL code on such systems.

0


source


My solution for the same problem - although I have used all the contributions mentioned above correctly,

I created a new project with Intel's "CodeBuilder Project for Windows" -template (Installed \ Templates \ Visual C ++ \ OpenCL) and copied my content into this new project.

After that hit the breakpoints.

0


source







All Articles