This wraps the image and rw images usages in the correct macros
Details
Diff Detail
Event Timeline
found a few more places to replace these and fix them up. there might still be some strays in there.
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.
@airlied are you still planning to land this? I started looking at the corresponding .td changes when I realized we don't use __opencl_c_read_write_images in opencl-c.h either yet. :-)