<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Debbuger lines offset  in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Debbuger-lines-offset/m-p/767601#M98</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I've been working for quite a while with 1.5 x64 SDK version since it was released.&lt;BR /&gt;Just today I've updated to the latest 2012 x64 SDK. &lt;BR /&gt;&lt;BR /&gt;Details:&lt;BR /&gt;What I've noticed is that sometimes while Debbuging you OpenCL code (*.cl) &lt;BR /&gt;the position of the current execution line does not corresponds with actual line in the file.&lt;BR /&gt;&lt;BR /&gt;Take a look at my example screenshot. I've placed debug break point at the begin of the kernel.&lt;BR /&gt;So, debugger stopped at that break point, but actually it is not there. Only after stepping over 7 lines &lt;BR /&gt;variable uint gi = get_global_id(0) will be initialized. &lt;BR /&gt;The OpenCLJIT says: OpenCLJIT!BSplineDecompositionImageFilter() Line:173 &lt;BR /&gt;but actually line uint gi = get_global_id(0); located on 166&lt;BR /&gt;&lt;BR /&gt;Also if the OpenCL function is very simple like this:&lt;BR /&gt;&lt;BR /&gt;float compute(const float index,&lt;BR /&gt; __global const INPIXELTYPE* in)&lt;BR /&gt;{&lt;BR /&gt; return 0.0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;You will not be able to put exact breakpoint inside. So, what I have to do is to put &lt;BR /&gt;more breakpoints below this function hoping some of them will be triggered. &lt;BR /&gt;That is crazy way of working.&lt;BR /&gt;&lt;BR /&gt;I' don't know what is the cause of this problem. I've tried to experiment with Linux/Windows file formats,&lt;BR /&gt;tabs vs spaces, removing comments, making all parameters of the functions in one line &lt;BR /&gt;float compute(const float index, __global const INPIXELTYPE* in)&lt;BR /&gt;&lt;BR /&gt;No effect. Also for some *cl files all the sudden it is working properly. &lt;BR /&gt;Also I can just close my solution and open one of the Intel's examples and it is perfectly fine.&lt;BR /&gt;&lt;BR /&gt;I was hoping that 2012 SDK will solve it, but not :/ &lt;BR /&gt;This problem still exist both for VisualStudio 9 and 10 in 2012 SDK and 1.5 SDK.&lt;BR /&gt;&lt;BR /&gt;Do you have any ideas what could trigger this behaviour in Intel OpenCL debbuger?&lt;BR /&gt;I've attached screenshot from VisualStudio 10&lt;BR /&gt;&lt;BR /&gt;Thanks, Denis&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="43502-debbuger_offset_line.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/10056iAAC02712DE208111/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="43502-debbuger_offset_line.png" alt="43502-debbuger_offset_line.png" /&gt;&lt;/span&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 24 Apr 2012 10:57:44 GMT</pubDate>
    <dc:creator>dpshamonin</dc:creator>
    <dc:date>2012-04-24T10:57:44Z</dc:date>
    <item>
      <title>Debbuger lines offset</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Debbuger-lines-offset/m-p/767601#M98</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I've been working for quite a while with 1.5 x64 SDK version since it was released.&lt;BR /&gt;Just today I've updated to the latest 2012 x64 SDK. &lt;BR /&gt;&lt;BR /&gt;Details:&lt;BR /&gt;What I've noticed is that sometimes while Debbuging you OpenCL code (*.cl) &lt;BR /&gt;the position of the current execution line does not corresponds with actual line in the file.&lt;BR /&gt;&lt;BR /&gt;Take a look at my example screenshot. I've placed debug break point at the begin of the kernel.&lt;BR /&gt;So, debugger stopped at that break point, but actually it is not there. Only after stepping over 7 lines &lt;BR /&gt;variable uint gi = get_global_id(0) will be initialized. &lt;BR /&gt;The OpenCLJIT says: OpenCLJIT!BSplineDecompositionImageFilter() Line:173 &lt;BR /&gt;but actually line uint gi = get_global_id(0); located on 166&lt;BR /&gt;&lt;BR /&gt;Also if the OpenCL function is very simple like this:&lt;BR /&gt;&lt;BR /&gt;float compute(const float index,&lt;BR /&gt; __global const INPIXELTYPE* in)&lt;BR /&gt;{&lt;BR /&gt; return 0.0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;You will not be able to put exact breakpoint inside. So, what I have to do is to put &lt;BR /&gt;more breakpoints below this function hoping some of them will be triggered. &lt;BR /&gt;That is crazy way of working.&lt;BR /&gt;&lt;BR /&gt;I' don't know what is the cause of this problem. I've tried to experiment with Linux/Windows file formats,&lt;BR /&gt;tabs vs spaces, removing comments, making all parameters of the functions in one line &lt;BR /&gt;float compute(const float index, __global const INPIXELTYPE* in)&lt;BR /&gt;&lt;BR /&gt;No effect. Also for some *cl files all the sudden it is working properly. &lt;BR /&gt;Also I can just close my solution and open one of the Intel's examples and it is perfectly fine.&lt;BR /&gt;&lt;BR /&gt;I was hoping that 2012 SDK will solve it, but not :/ &lt;BR /&gt;This problem still exist both for VisualStudio 9 and 10 in 2012 SDK and 1.5 SDK.&lt;BR /&gt;&lt;BR /&gt;Do you have any ideas what could trigger this behaviour in Intel OpenCL debbuger?&lt;BR /&gt;I've attached screenshot from VisualStudio 10&lt;BR /&gt;&lt;BR /&gt;Thanks, Denis&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="43502-debbuger_offset_line.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/10056iAAC02712DE208111/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="43502-debbuger_offset_line.png" alt="43502-debbuger_offset_line.png" /&gt;&lt;/span&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Apr 2012 10:57:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Debbuger-lines-offset/m-p/767601#M98</guid>
      <dc:creator>dpshamonin</dc:creator>
      <dc:date>2012-04-24T10:57:44Z</dc:date>
    </item>
    <item>
      <title>Debbuger lines offset</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Debbuger-lines-offset/m-p/767602#M99</link>
      <description>Hi Denis,&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;I have
noticed similar behavior on some of the NVidia samples that preprocess the
kernel file to add some "header" text to it. So clCreateProgramWithSource
uses modified file while the original is displayed to the user in MS VS.&lt;/P&gt;&lt;P&gt;Could you please check that you pass the same (unmodified) file to clCreateProgramWithSource?&lt;/P&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Yuri</description>
      <pubDate>Tue, 24 Apr 2012 11:34:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Debbuger-lines-offset/m-p/767602#M99</guid>
      <dc:creator>Yuri_K_Intel</dc:creator>
      <dc:date>2012-04-24T11:34:24Z</dc:date>
    </item>
    <item>
      <title>Debbuger lines offset</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Debbuger-lines-offset/m-p/767603#M100</link>
      <description>Hi Yuri,&lt;BR /&gt;&lt;BR /&gt;AH! Indead! I am using modified version of the oclUtils.h from NVIDIA&lt;BR /&gt;&lt;BR /&gt;//////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;//! Loads a Program file and prepends the cPreamble to the code.&lt;BR /&gt;//!&lt;BR /&gt;//! @return the source string if succeeded, 0 otherwise&lt;BR /&gt;//! @param cFilename program filename&lt;BR /&gt;//! @param cPreamble code that is prepended to the loaded file, typically a set of #defines or a header&lt;BR /&gt;//! @param szFinalLength returned length of the code string&lt;BR /&gt;//////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;extern "C" char* oclLoadProgSource(const char* cFilename, const char* cPreamble, size_t* szFinalLength);&lt;BR /&gt;&lt;BR /&gt;In this implementation you are able to prepend cPreamble to the begin of the file, in my case that is:&lt;BR /&gt;#define DIM_1&lt;BR /&gt;#define BUFFSIZE 4084&lt;BR /&gt;#define BUFFPIXELTYPE float&lt;BR /&gt;#define INPIXELTYPE short&lt;BR /&gt;#define OUTPIXELTYPE float&lt;BR /&gt;&lt;BR /&gt;Thats why I am keep getting this offset! Oh! Did not realize it till you reply :)&lt;BR /&gt;Maybe that is good idea to add NOTE somewhere on &lt;BR /&gt;&lt;A href="http://software.intel.com/en-us/articles/debugging-opencl-kernels-using-intel-opencl-sdk-debugger/" target="_blank"&gt;http://software.intel.com/en-us/articles/debugging-opencl-kernels-using-intel-opencl-sdk-debugger/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;That if you are planing to use debugging, make sure that you have not changed you original code located on disk by adding extra #defines or functions created on the fly, otherwise you will get this type of problem :)&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Denis&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Apr 2012 12:53:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Debbuger-lines-offset/m-p/767603#M100</guid>
      <dc:creator>dpshamonin</dc:creator>
      <dc:date>2012-04-24T12:53:12Z</dc:date>
    </item>
  </channel>
</rss>

