[cfe-dev] About OpenCL 2.x Dynamic Parallelism

Bekket McClane via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 16 19:51:30 PDT 2016

Our lab is working on compiling opencl 2.x into NVPTX
But we have encountered some problems in dynamic parallelism. Blocks,
In short, clang would try to use Objective-C's approach to compile blocks
in CL code.
It would generate block_literal struct to hold block information and
block_descriptor to hold captured variables.

My first question is:
There is a field in block_literal called "isa" representing the type of
this block. But this field seems to always set to external symbols starts
with "_NS", which is Cocoa's symbols. Is this necessary?

Second, clang put captured variables in block_descriptor and passed the
entire block_literal, which also contains a field holding pointer to a
block_descriptor instance, as a implicit "0 th" arguments for the real
invoked function. But it seems that this approach doesn't wok well with CL
language since it's hard to handling the address space of block_literal
We have an idea passing all of the captured variables as function
arguments, by value, for the invoked function. What do you folks think?

Last but not the least, Is there anyone working on implementing dynamic
parallelism? There seems to be no discussions about that on this mailing

Best Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160317/1df35152/attachment.html>

More information about the cfe-dev mailing list