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

Alexey Bader via cfe-commits cfe-commits at lists.llvm.org
Tue May 31 07:38:00 PDT 2016


bader added a comment.

Sorry for the delay.

Is this code valid:

  clk_event_t e1, e2, e3;
  clk_event_t events[] = {e1, e2};
  enqueue_kernel(get_default_queue(), 0, get_ndrange(), 2, events, &e3, ...);

With this patch clang rejects it with an error:

  'illegal call to enqueue_kernel, expected 'clk_event_t *' argument type'

C rules allows implicit conversion of to pointer by taking address of the first element of the array.


================
Comment at: lib/Sema/SemaChecking.cpp:154
@@ +153,3 @@
+                                     unsigned NumNonVarArgs) {
+  const BlockPointerType *BPT = cast<BlockPointerType>(BlockArg->getType());
+  unsigned NumBlockParams =
----------------
Here block type must be canonical too.


http://reviews.llvm.org/D20249





More information about the cfe-commits mailing list