<?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 Wrong alignment when passing structs to a kernel in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Wrong-alignment-when-passing-structs-to-a-kernel/m-p/1163171#M6369</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am using&amp;nbsp;&lt;CODE&gt;&lt;STRONG&gt;clSetKernelArg&lt;/STRONG&gt;&lt;/CODE&gt; to pass a struct with cl_float3 values to the kernel.&lt;BR /&gt;
	cl_float3 is the same as cl_float4 and needs to be aligned at 16 byte boundary according to the OpenCL specification.&lt;BR /&gt;
	This works fine with various vendors, but not for Intel due to misalignments.&lt;BR /&gt;
	Please fix the alignment to match the required alignment of the structure in the kernel argument.&lt;/P&gt;

&lt;P&gt;Attached you can find an example application. The expected alignment values are the least possible values to work without vload/vstore.&lt;/P&gt;

&lt;PRE&gt;using device:   Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
device version: OpenCL 1.2 (Build 63463)
driver version: 1.2
result:          4,  4,  4,  8, 16
expected:        4, 16, 16,  4, 16&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 25 Nov 2017 13:13:03 GMT</pubDate>
    <dc:creator>dstarke</dc:creator>
    <dc:date>2017-11-25T13:13:03Z</dc:date>
    <item>
      <title>Wrong alignment when passing structs to a kernel</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Wrong-alignment-when-passing-structs-to-a-kernel/m-p/1163171#M6369</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am using&amp;nbsp;&lt;CODE&gt;&lt;STRONG&gt;clSetKernelArg&lt;/STRONG&gt;&lt;/CODE&gt; to pass a struct with cl_float3 values to the kernel.&lt;BR /&gt;
	cl_float3 is the same as cl_float4 and needs to be aligned at 16 byte boundary according to the OpenCL specification.&lt;BR /&gt;
	This works fine with various vendors, but not for Intel due to misalignments.&lt;BR /&gt;
	Please fix the alignment to match the required alignment of the structure in the kernel argument.&lt;/P&gt;

&lt;P&gt;Attached you can find an example application. The expected alignment values are the least possible values to work without vload/vstore.&lt;/P&gt;

&lt;PRE&gt;using device:   Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
device version: OpenCL 1.2 (Build 63463)
driver version: 1.2
result:          4,  4,  4,  8, 16
expected:        4, 16, 16,  4, 16&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 13:13:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Wrong-alignment-when-passing-structs-to-a-kernel/m-p/1163171#M6369</guid>
      <dc:creator>dstarke</dc:creator>
      <dc:date>2017-11-25T13:13:03Z</dc:date>
    </item>
  </channel>
</rss>

