[PATCH] D106260: [OpenCL] Add support of __opencl_c_3d_image_writes feature macro

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 20 07:49:27 PDT 2021


Anastasia added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10092
     "use of type 'double' requires %select{cl_khr_fp64|cl_khr_fp64 and __opencl_c_fp64}0 support">;
+def err_opencl_3d_image_writes_requires_extensions : Error<
+    "use of type '__write_only image3d_t' requires %select{cl_khr_3d_image_writes|cl_khr_3d_image_writes and "
----------------
it seems like we keep expanding similar diagnostics which flows against the design policy. Could you try to unify with `err_opencl_double_requires_extension` or even with `err_opencl_requires_extension`?

Perhaps we could create a mechanism to print custom strings for extensions that alias features or it can be done in the follow-up patches too?


================
Comment at: clang/lib/Sema/SemaType.cpp:1732-1734
+    // __opencl_c_3d_image_writes feature. OpenCL C v3.0 API s4.2 - For devices
+    // that support OpenCL 3.0, cl_khr_3d_image_writes must be returned when and
+    // only when the optional feature is supported
----------------
azabaznov wrote:
> Note this. Is it OK to refer to API spec here?
I am guessing you want to explain that corresponding features and extensions must be in sync?

It makes sense, but it feels like we are missing something in the kernel language spec then...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106260



More information about the cfe-commits mailing list