Skip to content

Commit

Permalink
[OpenCL][Docs] Describe extension for legacy atomics with generic add…
Browse files Browse the repository at this point in the history
…r space.

This extension is primarily targeting SPIR-V compilations flow
as the IR translation is the same between 1.x and 2.x atomics.

Differential Revision: https://reviews.llvm.org/D101089
  • Loading branch information
Anastasia Stulova committed Apr 29, 2021
1 parent a0e1313 commit 8fb0d6d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions clang/docs/LanguageExtensions.rst
Expand Up @@ -1813,6 +1813,23 @@ supporting the variadic arguments e.g. majority of CPU targets.
#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 the OpenCL 1.x standards
with the generic address space pointer in C++ for OpenCL mode.
This is a non-portable feature and might not be supported by all
targets.
**Example of Use**:
.. code-block:: c++
void foo(__generic volatile unsigned int* a) {
atomic_add(a, 1);
}
Builtin Functions
=================
Expand Down

0 comments on commit 8fb0d6d

Please sign in to comment.