Anastasia created this revision. Anastasia added a reviewer: svenvh. Herald added subscribers: ebevhan, jfb, yaxunl. Anastasia requested review of this revision.
There were multiple requests from the developers to allow this functionality in OpenCL https://github.com/KhronosGroup/OpenCL-Docs/issues/66 and this can be supported already in some tool flows i.e. using SPIRV-LLVM Translator. However, there hasn't been enough progress on the core spec side. Therefore, I suggest documenting this as a clang extension for now. https://reviews.llvm.org/D101089 Files: clang/docs/LanguageExtensions.rst Index: clang/docs/LanguageExtensions.rst =================================================================== --- clang/docs/LanguageExtensions.rst +++ clang/docs/LanguageExtensions.rst @@ -1813,6 +1813,20 @@ #pragma OPENCL EXTENSION __cl_clang_variadic_functions : disable void bar(int a, ...); // error - variadic prototype is not allowed +Legacy 1.x atomics with generic address space +--------------------------------------------- + +Clang allows use of atomic functions from earlier than OpenCL 2.0 +standard with generic address space pointer in C++ for OpenCL mode. + +**Example of Use**: + +.. code-block:: c++ + + void foo(__generic volatile unsigned int* a) { + atomic_add(a, 1); + } + Builtin Functions =================
Index: clang/docs/LanguageExtensions.rst =================================================================== --- clang/docs/LanguageExtensions.rst +++ clang/docs/LanguageExtensions.rst @@ -1813,6 +1813,20 @@ #pragma OPENCL EXTENSION __cl_clang_variadic_functions : disable void bar(int a, ...); // error - variadic prototype is not allowed +Legacy 1.x atomics with generic address space +--------------------------------------------- + +Clang allows use of atomic functions from earlier than OpenCL 2.0 +standard with generic address space pointer in C++ for OpenCL mode. + +**Example of Use**: + +.. code-block:: c++ + + void foo(__generic volatile unsigned int* a) { + atomic_add(a, 1); + } + Builtin Functions =================
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits