[PATCH] D107539: [OpenCL] opencl-c.h: add __opencl_c_images and __opencl_c_read_write_images
Anastasia Stulova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 6 08:36:02 PDT 2021
Anastasia added a subscriber: svenvh.
Anastasia added a comment.
LGTM! Thanks.
CC to @azabaznov for any final feedback.
FYI this has not been officially announced but in `clang-14` we would like to transition away from using the huge hard to maintain `opencl-c.h` in favour of a more concise and fast to parse Tablegen based approach to declare builtin functions: https://clang.llvm.org/docs/OpenCLSupport.html#opencl-builtins. As a matter of fact to mature Tablegen-based solution it has been enabled by default in `clang-13` without any extra flags https://clang.llvm.org/docs/UsersManual.html#opencl-header. And it is therefore now a primary header exposed to the application developer in upstream clang.
Since there has not been an announcement yet we don't make it a hard requirement yet but it is highly encouraged to mirror any new functionality into `OpenCLBuiltins.td`. Conditioning functions as in this patch is usually quite straightforward, it just needs an extra clause around builtin declarations:
let Extension = <extension or feature name> in {
...
}
And new features/extensions can be registered with:
def <Name> : FunctionExtension<"macro_name1 macro_name2 ...">;
Here is one example that illustrates the idea https://reviews.llvm.org/D106434
Tablegen-header has full functionality of OpenCL 2.0 so it should be possible to extend it to OpenCL 3.0 without significant effort.
Both me and @svenvh would be happy to provide more information and review should you decide to help mantaining Tablegen-header in sync with new changes.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107539/new/
https://reviews.llvm.org/D107539
More information about the cfe-commits
mailing list