<?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 Compiling OpenCL 2.0 atomics in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Compiling-OpenCL-2-0-atomics/m-p/1058292#M4161</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to compile a simple kernel using OpenCL 2.0 atomics using exactly the device, driver, and kernel described in:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/forums/topic/556904" target="_blank"&gt;https://software.intel.com/en-us/forums/topic/556904&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;However, I cannot even get the kernel to compile, as it does not seem to recognize the atomic types and functions. My error log (along with some environment info) is:&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp; -- device info --&lt;BR /&gt;
	DEVICE_NAME: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Intel(R) HD Graphics 5500&lt;BR /&gt;
	DEVICE_VENDOR: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Intel(R) Corporation&lt;BR /&gt;
	DEVICE_VERSION: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OpenCL 2.0&amp;nbsp;&lt;BR /&gt;
	DRIVER_VERSION: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10.18.14.4029&lt;BR /&gt;
	&lt;BR /&gt;
	:6:62: error: unknown type name 'atomic_int'&lt;BR /&gt;
	kernel void atomics_test(global int *output, volatile global atomic_int* &amp;nbsp;atomicBuffer, uint iterations, uint offset)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;^&lt;BR /&gt;
	:10:9: error: implicit declaration of function 'atomic_fetch_add_explicit' is invalid in OpenCL&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; atomic_fetch_add_explicit(&amp;amp;atomicBuffer[0], MY_ADD_VALUE, memory_order_relaxed, memory_scope_device);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ^&lt;/P&gt;

&lt;P&gt;error: front end compiler failed build.&lt;/P&gt;

&lt;P&gt;Am I missing an include or an extension to enable? I tried searching through the docs but couldn't find anything. For example, the Atomic Function page doesn't seem to describe any includes or extensions to use 'atomic_int':&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.khronos.org/registry/cl/sdk/2.0/docs/man/xhtml/atomicFunctions.html" target="_blank"&gt;https://www.khronos.org/registry/cl/sdk/2.0/docs/man/xhtml/atomicFunctions.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;</description>
    <pubDate>Fri, 21 Aug 2015 00:16:18 GMT</pubDate>
    <dc:creator>Tyler_S_2</dc:creator>
    <dc:date>2015-08-21T00:16:18Z</dc:date>
    <item>
      <title>Compiling OpenCL 2.0 atomics</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Compiling-OpenCL-2-0-atomics/m-p/1058292#M4161</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to compile a simple kernel using OpenCL 2.0 atomics using exactly the device, driver, and kernel described in:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/forums/topic/556904" target="_blank"&gt;https://software.intel.com/en-us/forums/topic/556904&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;However, I cannot even get the kernel to compile, as it does not seem to recognize the atomic types and functions. My error log (along with some environment info) is:&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp; -- device info --&lt;BR /&gt;
	DEVICE_NAME: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Intel(R) HD Graphics 5500&lt;BR /&gt;
	DEVICE_VENDOR: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Intel(R) Corporation&lt;BR /&gt;
	DEVICE_VERSION: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OpenCL 2.0&amp;nbsp;&lt;BR /&gt;
	DRIVER_VERSION: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10.18.14.4029&lt;BR /&gt;
	&lt;BR /&gt;
	:6:62: error: unknown type name 'atomic_int'&lt;BR /&gt;
	kernel void atomics_test(global int *output, volatile global atomic_int* &amp;nbsp;atomicBuffer, uint iterations, uint offset)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;^&lt;BR /&gt;
	:10:9: error: implicit declaration of function 'atomic_fetch_add_explicit' is invalid in OpenCL&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; atomic_fetch_add_explicit(&amp;amp;atomicBuffer[0], MY_ADD_VALUE, memory_order_relaxed, memory_scope_device);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ^&lt;/P&gt;

&lt;P&gt;error: front end compiler failed build.&lt;/P&gt;

&lt;P&gt;Am I missing an include or an extension to enable? I tried searching through the docs but couldn't find anything. For example, the Atomic Function page doesn't seem to describe any includes or extensions to use 'atomic_int':&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.khronos.org/registry/cl/sdk/2.0/docs/man/xhtml/atomicFunctions.html" target="_blank"&gt;https://www.khronos.org/registry/cl/sdk/2.0/docs/man/xhtml/atomicFunctions.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2015 00:16:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Compiling-OpenCL-2-0-atomics/m-p/1058292#M4161</guid>
      <dc:creator>Tyler_S_2</dc:creator>
      <dc:date>2015-08-21T00:16:18Z</dc:date>
    </item>
    <item>
      <title>Did you provide the Build</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Compiling-OpenCL-2-0-atomics/m-p/1058293#M4162</link>
      <description>&lt;P&gt;Did you provide the Build flag&amp;nbsp;&amp;nbsp; -cl-std=CL2.0&amp;nbsp; ?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2015 00:26:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Compiling-OpenCL-2-0-atomics/m-p/1058293#M4162</guid>
      <dc:creator>Robert_I_Intel</dc:creator>
      <dc:date>2015-08-21T00:26:18Z</dc:date>
    </item>
    <item>
      <title>Thanks for the fast reply</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Compiling-OpenCL-2-0-atomics/m-p/1058294#M4163</link>
      <description>&lt;P&gt;Thanks for the fast reply Robert! That did it.&lt;/P&gt;

&lt;P&gt;I was looking at the&amp;nbsp;clBuildProgram docs for OpenCL 1.x which doesn't include this option. Of course, when I look at&amp;nbsp;clBuildProgram doc for 2.0, this option is documented.&lt;/P&gt;

&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2015 00:31:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Compiling-OpenCL-2-0-atomics/m-p/1058294#M4163</guid>
      <dc:creator>Tyler_S_2</dc:creator>
      <dc:date>2015-08-21T00:31:43Z</dc:date>
    </item>
  </channel>
</rss>

