[PATCH] D20249: [OpenCL] Hierarchical/dynamic parallelism - enqueue kernel in OpenCL 2.0

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 24 12:09:13 PDT 2016


Anastasia marked 4 inline comments as done.

================
Comment at: lib/Sema/SemaChecking.cpp:145
@@ +144,3 @@
+}
+
+/// OpenCL v2.0, s6.13.17.1 - Check that sizes are provided for all
----------------
I think the problem is that in C99 there are implicit casts among integer types, therefore making this check more restrictive would imply the cast has to be done explicitly instead.

Thus, this would have to be modified as follows:

  enqueue_kernel(...,  64); -> enqueue_kernel(...,  (uint)64); or enqueue_kernel(...,  64U);

which in my opinion is undesirable and also a bit unexpected because by analogy to C99 you can compile the following successfully:
  
  void g(unsigned);

  void f() {
    char i;
    g(i);
  }

I have added a check for a size however not to be larger than 32 bits and handled type cast in CodeGen. The test cases are added too.

What's your opinion about it?

================
Comment at: lib/Sema/SemaChecking.cpp:302
@@ +301,3 @@
+
+  // None of the specific case has been detected, give generic error
+  S.Diag(TheCall->getLocStart(),
----------------
This error is when we can't deduce exactly which overload is meant to be and we are giving more general error (like it's ambiguous). You can see some examples in tests. We could of course go further and specify possible candidates, but it would complicate the story even more.


http://reviews.llvm.org/D20249





More information about the cfe-commits mailing list