- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to compile a simple kernel using OpenCL 2.0 atomics using exactly the device, driver, and kernel described in:
https://software.intel.com/en-us/forums/topic/556904
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:
-- device info --
DEVICE_NAME: Intel(R) HD Graphics 5500
DEVICE_VENDOR: Intel(R) Corporation
DEVICE_VERSION: OpenCL 2.0
DRIVER_VERSION: 10.18.14.4029
:6:62: error: unknown type name 'atomic_int'
kernel void atomics_test(global int *output, volatile global atomic_int* atomicBuffer, uint iterations, uint offset)
^
:10:9: error: implicit declaration of function 'atomic_fetch_add_explicit' is invalid in OpenCL
atomic_fetch_add_explicit(&atomicBuffer[0], MY_ADD_VALUE, memory_order_relaxed, memory_scope_device);
^
error: front end compiler failed build.
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':
https://www.khronos.org/registry/cl/sdk/2.0/docs/man/xhtml/atomicFunctions.html
Thanks a lot in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you provide the Build flag -cl-std=CL2.0 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the fast reply Robert! That did it.
I was looking at the clBuildProgram docs for OpenCL 1.x which doesn't include this option. Of course, when I look at clBuildProgram doc for 2.0, this option is documented.
Thanks again!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page