[PATCH] D106778: [OpenCL] opencl-c.h: add CL 3.0 non-generic address space atomics

Anton Zabaznov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 29 19:54:01 PDT 2021


azabaznov added inline comments.


================
Comment at: clang/lib/Headers/opencl-c.h:13303
 #endif
+#elif __OPENCL_C_VERSION__ >= CL_VERSION_3_0
+void __ovld atomic_init(volatile __global atomic_int *object, int value);
----------------
Sorry, I overlooked that. Not //elif//, just //if// as these are available in 3.0 even with generic address space feature (https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_C.html#the-atomic_init-function):

```
// Requires OpenCL C 3.0 or newer.
void atomic_init(volatile __global A *obj, C value)
void atomic_init(volatile __local A *obj, C value)

// Requires OpenCL C 2.0, or OpenCL C 3.0 or newer and the
// __opencl_c_generic_address_space feature.
void atomic_init(volatile A *obj, C value)
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106778/new/

https://reviews.llvm.org/D106778



More information about the cfe-commits mailing list