[cfe-dev] Clang and CUDA with C++11 features
peter at colberg.org
Fri Jun 15 08:59:59 PDT 2012
On Fri, Jun 15, 2012 at 08:31:50AM -0700, Manjunath Kudlur wrote:
> As Justin mentioned, I don't think the right plumbing exists that uses the
> frontend support for parsing and lowering the CUDA syntax and connects it
> to the NVPTX backend. For instance, from the IR, it looks like the kernel
> function pointer is just cast to i8* and passed to cudaLaunch. cudaLaunch
> requires the name of the kernel to passed a char string.
Definitely not, otherwise my cudaLaunch wrapper would be failing since 2007 ;-).
The advantage of the CUDA runtime library, as opposed to the CUDA
driver library, lies in the convenient execution of kernels.
When the nvcc frontend converts the <<< >>> syntax to proper C++ code,
it does not pass a char string to cudaLaunch, but an actual pointer.
The only question is how to get that pointer in Clang…
If you are interested, have a look at the preprocessed C++ output of
the nvcc frontend of a simple kernel call.
> I feel CUDA support needs lot of work before becoming usable.
Yes, that is indeed the case… :-(
More information about the cfe-dev