[PATCH] D119420: [OpenCL] Add OpenCL 3.0 atomics to -fdeclare-opencl-builtins

Sven van Haastregt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 10 02:22:42 PST 2022


svenvh created this revision.
svenvh added reviewers: Anastasia, haonanya.
svenvh added a project: clang.
Herald added subscribers: Naghasan, ldrumm, yaxunl.
svenvh requested review of this revision.
Herald added a subscriber: cfe-commits.

Add the atomic overloads for the `global` and `local` address spaces,
which are new in OpenCL 3.0.  Ensure the preexisting `generic`
overloads are guarded by the generic address space feature macro.

Ensure a subset of the atomic builtins are guarded by the
`__opencl_c_atomic_order_seq_cst` and `__opencl_c_atomic_scope_device`
feature macros, and enable those macros for SPIR/SPIR-V targets in
`opencl-c-base.h`.

Also guard the `cl_ext_float_atomics` builtins with the atomic order
and scope feature macros.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119420

Files:
  clang/lib/Headers/opencl-c-base.h
  clang/lib/Sema/OpenCLBuiltins.td
  clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119420.407432.patch
Type: text/x-patch
Size: 14812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220210/55cdc892/attachment-0001.bin>


More information about the cfe-commits mailing list