[cfe-dev] Clang and CUDA with C++11 features
Justin Holewinski
justin.holewinski at gmail.com
Thu Jun 14 11:21:21 PDT 2012
On Thu, Jun 14, 2012 at 2:08 PM, Peter Colberg <peter at colberg.org> wrote:
> On Thu, Jun 14, 2012 at 09:57:27AM -0400, Justin Holewinski wrote:
> > Something is probably getting messed up in the IR generation for the
> kernel
> > functions (we recently got rid of the old PTX back-end, on which the CUDA
> > integration is based, in favor of the NVPTX back-end). If you post the
> IR,
> > I can take a look at it.
>
> I attached the CUDA source and the LLVM IR.
>
> clang++ -S -emit-llvm -I/usr/local/cuda-4.2/cuda/include -o kernel-call.s
> kernel-call.cu
>
> clang++ -I/usr/local/cuda-4.2/cuda/include
> -L/usr/local/cuda-4.2/cuda/lib64 -lcudart -o kernel-call kernel-call.cu
>
> ./kernel-call
> Using CUDA device #0
> 42 == 0
>
> clang++ --version
> clang version 3.2 (http://llvm.org/git/clang.gitf1492f970c7c6eb85dc18f13fb864b185bed1d23) (
> http://llvm.org/git/llvm.git cba91230c0beef79e5042d8e983198b26aac5616)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
>
The attached IR is for the host, not the device. I haven't played around
with the CUDA front-end in Clang, but I don't think the plumbing is hooked
up to generate PTX device code and embed it into the final binary. Someone
who works on the front-end would be better able to comment.
>
> Thanks,
> Peter
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
--
Thanks,
Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120614/bd362965/attachment.html>
More information about the cfe-dev
mailing list