[PATCH] D115640: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 16 04:11:41 PST 2021


Anastasia added a comment.

> This feature requires support of opencl_c_generic_address_space and

opencl_c_program_scope_global_variables so diagnostics for that is provided as well.

Do we have a spec issue for it or a PR? It would be good to list it here since it is not yet published in the registry.



================
Comment at: clang/lib/Sema/Sema.cpp:329
+    if (OCLCompatibleVersion >= 200) {
+      if ((OCLCompatibleVersion == 200) ||
+          (OCLCompatibleVersion == 300 && getLangOpts().Blocks)) {
----------------
Here it should be sufficient to just check `getLangOpts().Blocks` only wothout the versions.


================
Comment at: clang/test/Misc/opencl-c-3.0.incorrect_options.cl:21
+
 // CHECK-FP64: error: options cl_khr_fp64 and __opencl_c_fp64 are set to different values
 
----------------
I can't remember if we have discussed this already, but could we use `-verify` for these errors?


================
Comment at: clang/test/SemaOpenCL/invalid-device-enqueue-types-cl3.0.cl:5
+void f() {
+  clk_event_t e;
+  queue_t q;
----------------
I know that many test have prefix "invalid" but I feel we have failed to establish the meaning for it because most of the tests in Sema are testing some sort of invalid behavior. But also here I feel that we should test that `enqueue_kernel` is not supported?

Do you think we chould merge this testing together with `SemaOpenCL/cl20-device-side-enqueue.cl` with some filename renaming?

Technically we should do the same testing even for CL1.x versions...


================
Comment at: clang/test/SemaOpenCL/storageclass.cl:2
 // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=-__opencl_c_program_scope_global_variables,-__opencl_c_generic_address_space,-__opencl_c_pipes
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_program_scope_global_variables,-__opencl_c_generic_address_space,-__opencl_c_pipes
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=-__opencl_c_program_scope_global_variables,+__opencl_c_generic_address_space
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=-__opencl_c_program_scope_global_variables,-__opencl_c_generic_address_space,-__opencl_c_pipes,-__opencl_c_device_enqueue
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_program_scope_global_variables,-__opencl_c_generic_address_space,-__opencl_c_pipes,-__opencl_c_device_enqueue
----------------
These lines are getting a bit longer. Do we actually need to set `-__opencl_c_device_enqueue` for this test? Same for some other tests...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115640



More information about the cfe-commits mailing list