[PATCH] D95523: [OpenCL] Add cl_khr_subgroup_ballot to TableGen BIFs

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 1 10:57:29 PST 2021


Anastasia added inline comments.


================
Comment at: clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl:35
+// Enable extensions that are enabled in opencl-c-base.h.
+#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
+#define cl_khr_subgroup_ballot 1
----------------
Not related to this patch - I think we should have included `opencl-c-base.h` by default when passing `-fdeclare-opencl-builtins` or do you see any issues with that?




================
Comment at: clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl:141
+kernel void extended_subgroup(global uint4 *out) {
+  out[0] = get_sub_group_eq_mask();
+#if __OPENCL_C_VERSION__ < CL_VERSION_2_0 && !defined(__OPENCL_CPP_VERSION__)
----------------
I appreciate we haven't addressed the standard header testing holistically yet and this functionality was added in `opencl-c.h` without testing the functions, but would it be better to test each function at least here?

Even though the final goal should be testing all overloads, this is outside of the scope of this work that is closing the gap between `opencl-c.h` and this experimental function declaration mechanism.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95523/new/

https://reviews.llvm.org/D95523



More information about the cfe-commits mailing list