[PATCH] D92004: [OpenCL] add CL 3.0 optional feature support to opencl-c.h
Anastasia Stulova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 27 06:03:52 PST 2020
Anastasia added a comment.
Thanks! This looks much cleaner.
I am still unclear what should we do with testing though.
================
Comment at: clang/lib/Headers/opencl-c-base.h:284
memory_scope_work_group = __OPENCL_MEMORY_SCOPE_WORK_GROUP,
+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_scope_device))
memory_scope_device = __OPENCL_MEMORY_SCOPE_DEVICE,
----------------
I feel `__OPENCL_C_VERSION__ >= CL_VERSION_3_0` is redundant. Perhaps we don't need `__OPENCL_C_VERSION__ >= CL_VERSION_2_0` either if we define the feature macros above. Btw @azabaznov is planning to define those macros in this header in https://reviews.llvm.org/D89869#change-kc4kXsHko6uZ. I guess some rebase will be necessary at some point depending on which commit will be ready first.
================
Comment at: clang/lib/Headers/opencl-c.h:37
+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0 && __OPENCL_C_VERSION__ < CL_VERSION_3_0)
+#ifndef __opencl_c_generic_address_space
----------------
I guess here it should be:
```
defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
```
There are no OpenCL C language versions between 2.0 and 3.0.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92004/new/
https://reviews.llvm.org/D92004
More information about the cfe-commits
mailing list