<?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 thanks! in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041591#M3854</link>
    <description>&lt;P&gt;thanks!&lt;/P&gt;

&lt;P&gt;My workgroup size has to be 128 or 256 due to heavy shared memory usage. and the kernels are pretty large with more than 5k instructions. Also Opencl for AMD cards uses close to&amp;nbsp;64 registers (NVidia's compiler correctly switches to spilling a few and optimizes them down to 32 register per thread for maximum occupancy).&lt;/P&gt;

&lt;P&gt;Will setting required workgroup size to 256 or 128 force SIMD32 in this environment?&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jan 2015 17:54:26 GMT</pubDate>
    <dc:creator>Vladimir_T_</dc:creator>
    <dc:date>2015-01-07T17:54:26Z</dc:date>
    <item>
      <title>How to force SIMD32 compilation?</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041589#M3852</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have some code that was developed for CUDA and it relies heavily on 32-wide warps.&lt;/P&gt;

&lt;P&gt;Is there a way to force Intel GPU compiler to compile for SIMD32?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jan 2015 23:09:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041589#M3852</guid>
      <dc:creator>Vladimir_T_</dc:creator>
      <dc:date>2015-01-06T23:09:05Z</dc:date>
    </item>
    <item>
      <title>Hi Vladimir,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041590#M3853</link>
      <description>&lt;P&gt;Hi Vladimir,&lt;/P&gt;

&lt;P&gt;There is, but, unfortunately, it is not exposed in publicly available drivers. SIMD32 is selected automatically for small kernels only, e.g. kernels smaller than ~150 assembly instructions.&lt;/P&gt;

&lt;P&gt;I would recommend setting the work group size to 32 - this should give you the correct behavior.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 17:47:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041590#M3853</guid>
      <dc:creator>Robert_I_Intel</dc:creator>
      <dc:date>2015-01-07T17:47:09Z</dc:date>
    </item>
    <item>
      <title>thanks!</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041591#M3854</link>
      <description>&lt;P&gt;thanks!&lt;/P&gt;

&lt;P&gt;My workgroup size has to be 128 or 256 due to heavy shared memory usage. and the kernels are pretty large with more than 5k instructions. Also Opencl for AMD cards uses close to&amp;nbsp;64 registers (NVidia's compiler correctly switches to spilling a few and optimizes them down to 32 register per thread for maximum occupancy).&lt;/P&gt;

&lt;P&gt;Will setting required workgroup size to 256 or 128 force SIMD32 in this environment?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 17:54:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041591#M3854</guid>
      <dc:creator>Vladimir_T_</dc:creator>
      <dc:date>2015-01-07T17:54:26Z</dc:date>
    </item>
    <item>
      <title>Hi Vladimir,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041592#M3855</link>
      <description>&lt;P&gt;Hi Vladimir,&lt;/P&gt;

&lt;P&gt;Setting work group size to 128 and 256 would ensure correct behavior. With large kernels and heavy shared memory use, you are most likely to get SIMD8 compilation - forcing SIMD32, even if it was publicly available, wouldn't help - in fact, it would probably harm performance, in my experience. SIMD8 or SIMD16 compilation should not impact the correctness of the behavior though.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Let me know, if after translation to OpenCL you experience correctness issues.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 19:16:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041592#M3855</guid>
      <dc:creator>Robert_I_Intel</dc:creator>
      <dc:date>2015-01-07T19:16:36Z</dc:date>
    </item>
    <item>
      <title>Hm,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041593#M3856</link>
      <description>&lt;P&gt;Hm,&lt;/P&gt;

&lt;P&gt;the code specifically relies on warp_size being at least 32, so it does not have to call barriers all the time. It does aggregation between 32 threads in a warp and has only mem_fence between appropriate reads/writes.&lt;/P&gt;

&lt;P&gt;I'd assume that if it compiles with SIMD16 or 8, the warp_size will be 16 or 8, and threads may diverge and cause correctness issues. Is this the&amp;nbsp; case? Do I understand relationship between warp_Size, SIMDXX and the way work is scheduled correctly?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 19:37:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041593#M3856</guid>
      <dc:creator>Vladimir_T_</dc:creator>
      <dc:date>2015-01-07T19:37:41Z</dc:date>
    </item>
    <item>
      <title>Yes, if you have a code like</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041594#M3857</link>
      <description>&lt;P&gt;Yes, if you have a code like the following:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;if (i &amp;lt; 32)

foo&lt;I&gt; += foo&lt;I&gt; + foo[i + 32];

if (i &amp;lt; 16)

foo&lt;I&gt; += foo&lt;I&gt; + foo[i + 16];

if (i &amp;lt; 8)

foo&lt;I&gt; += foo&lt;I&gt; + foo[i + 8];

if (i &amp;lt; 4)

foo&lt;I&gt; += foo&lt;I&gt; + foo[i + 4];

​if (i &amp;lt; 2)

foo&lt;I&gt; += foo&lt;I&gt; + foo[i + 2];

if (i &amp;lt; 1)

foo&lt;I&gt; += foo&lt;I&gt; + foo[i + 1];&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;with no barriers, you will need to assume the worst case of SIMD8 and put couple of barriers in :(, so yes you may have correctness issues if you don't do that. If you can use OpenCL 2.0 (only on Broadwell chips, though), you can use work group scan functions for the cases above.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 19:53:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/How-to-force-SIMD32-compilation/m-p/1041594#M3857</guid>
      <dc:creator>Robert_I_Intel</dc:creator>
      <dc:date>2015-01-07T19:53:06Z</dc:date>
    </item>
  </channel>
</rss>

