<?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 Kernel execution crash on Linux! in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781512#M404</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;float3 needs to be aligned to 16byte boundary. I am guessing that your data was not aligned. The times it worked, the data was aligned by chance so you didn't see the crash.&lt;/P&gt;&lt;P&gt;Make sure you align the data to a float4 boundary and let me know if you still see the crash.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raghu &lt;/P&gt;</description>
    <pubDate>Thu, 19 Jul 2012 16:26:02 GMT</pubDate>
    <dc:creator>Raghupathi_M_Intel</dc:creator>
    <dc:date>2012-07-19T16:26:02Z</dc:date>
    <item>
      <title>Kernel execution crash on Linux!</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781509#M401</link>
      <description>Hello,&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I write a kernel for streamline generation. The interface is as follow.&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;__kernel void generateStreamlines (__global float3* flowData, __global float3* seeds, __global float3* streamlineVertex, __global float3* streamlineTangent,__global uint* streamlineVertexNum, GenerationParameters generationParameters, UniformGridInfo gridInfo)&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;GenerationParameters andUniformGridInfo are structs defined as follow.&lt;/DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV id="_mcePaste"&gt;typedef struct {&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	float3 lowBound;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	float3 upBound;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	float initStepSize;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	float maxLength; //max streamline length&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	float terminationSpeed;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	float adaptiveUpBound;//if &amp;gt;adaptiveUpBound, enlarge step size&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	float adaptiveLowBound;//if &amp;lt; adaptiveLowBound, reduce step size&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	uint maxStepNum;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;} GenerationParameters;&lt;/DIV&gt;&lt;DIV&gt;typedef struct {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;float3 origin;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;int3 extentLow;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;int3 extentUp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;float3 spacing;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;float3 reciprocalSpacing;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;float reciprocalSpacingXY;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;float reciprocalSpacingYZ;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;float reciprocalSpacingZX;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;float reciprocalSpacingXYZ;&lt;/DIV&gt;&lt;DIV&gt;} UniformGridInfo;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;The execution of this kernel crashed on the OpenSUSE 12.1 64bit with core i5-2500K. I test this kernel using AMD and Nvidia OpenCL implementation and all is OK.It is strange that changing the order of arguments or removing one argument can solve this problem for Intel OpenCL driver. Any advice? Thanks a lot!&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;ZHAO Peng&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 Jul 2012 03:32:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781509#M401</guid>
      <dc:creator>zhaopeng</dc:creator>
      <dc:date>2012-07-19T03:32:53Z</dc:date>
    </item>
    <item>
      <title>Kernel execution crash on Linux!</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781510#M402</link>
      <description>After more test I find that the cause may be related to the alignment of float3. So I replace float3 with plain float and everything is OK.&lt;DIV&gt;Be careful of float3 which may introduce problems. Even worse different OpenCL implementations have different symptoms&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 Jul 2012 11:19:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781510#M402</guid>
      <dc:creator>zhaopeng</dc:creator>
      <dc:date>2012-07-19T11:19:49Z</dc:date>
    </item>
    <item>
      <title>Kernel execution crash on Linux!</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781511#M403</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;float3 needs to be aligned to 16byte boundary. I am guessing that your data was not aligned. The times it worked, the data was aligned by chance so you didn't see the crash.&lt;BR /&gt;&lt;BR /&gt;Make sure you align the data to a float4 boundary and let me know if you still see the crash.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Raghu</description>
      <pubDate>Thu, 19 Jul 2012 16:10:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781511#M403</guid>
      <dc:creator>IDZ_A_Intel</dc:creator>
      <dc:date>2012-07-19T16:10:12Z</dc:date>
    </item>
    <item>
      <title>Kernel execution crash on Linux!</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781512#M404</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;float3 needs to be aligned to 16byte boundary. I am guessing that your data was not aligned. The times it worked, the data was aligned by chance so you didn't see the crash.&lt;/P&gt;&lt;P&gt;Make sure you align the data to a float4 boundary and let me know if you still see the crash.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raghu &lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2012 16:26:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781512#M404</guid>
      <dc:creator>Raghupathi_M_Intel</dc:creator>
      <dc:date>2012-07-19T16:26:02Z</dc:date>
    </item>
    <item>
      <title>Kernel execution crash on Linux!</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781513#M405</link>
      <description>Thanks for your reply!&lt;DIV&gt;From the specification&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;The OpenCL compiler is responsible for aligning data items to the appropriate alignment asrequired by the data type. For arguments to a __kernel function declared to be a pointer to adata type, the OpenCL compiler can assume that the pointee is always appropriately aligned asrequired by the data type.&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;Do you mean Intel's compiler do nothing about the alignment and leave it to users? I am not clear how to align data to float4 boundary. Do you mean change my 3-components data array to 4-components data array by adding one more component or just make the whole array size to be the multiple of 16?&lt;/DIV&gt;&lt;DIV&gt;I'll stick to use float because I need to process large data and don't want to waste an extra component. But I'd like to give a test.&lt;/DIV&gt;&lt;DIV&gt;Thanks again!&lt;/DIV&gt;&lt;DIV&gt;ZHAO Peng&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 20 Jul 2012 01:52:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781513#M405</guid>
      <dc:creator>zhaopeng</dc:creator>
      <dc:date>2012-07-20T01:52:18Z</dc:date>
    </item>
    <item>
      <title>Kernel execution crash on Linux!</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781514#M406</link>
      <description>If the compiler is responsible for aligning data then it should, otherwise it is a bug.If my understanding is right the compiler assumes that the __kernel arguments are properly aligned. &lt;BR /&gt;&lt;BR /&gt;What exactly is causing the problem? The structs or the float3 arguments? The float3 components are aligned to 16byte boundary so you don't need to add the padding. Can you create a small reproducer?&lt;BR /&gt;&lt;BR /&gt;You can read about alignment attribute in section 6.10 (1.1) or 6.11 (1.2), for forcing alignment.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Raghu&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Jul 2012 06:24:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Kernel-execution-crash-on-Linux/m-p/781514#M406</guid>
      <dc:creator>Raghupathi_M_Intel</dc:creator>
      <dc:date>2012-07-20T06:24:26Z</dc:date>
    </item>
  </channel>
</rss>

