<br><br><div class="gmail_quote">On Thu, Jun 14, 2012 at 2:08 PM, Peter Colberg <span dir="ltr"><<a href="mailto:peter@colberg.org" target="_blank">peter@colberg.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, Jun 14, 2012 at 09:57:27AM -0400, Justin Holewinski wrote:<br>
> Something is probably getting messed up in the IR generation for the kernel<br>
> functions (we recently got rid of the old PTX back-end, on which the CUDA<br>
> integration is based, in favor of the NVPTX back-end).  If you post the IR,<br>
> I can take a look at it.<br>
<br>
</div>I attached the CUDA source and the LLVM IR.<br>
<br>
clang++ -S -emit-llvm -I/usr/local/cuda-4.2/cuda/include -o kernel-call.s <a href="http://kernel-call.cu" target="_blank">kernel-call.cu</a><br>
<div class="im"><br>
clang++ -I/usr/local/cuda-4.2/cuda/include -L/usr/local/cuda-4.2/cuda/lib64 -lcudart -o kernel-call <a href="http://kernel-call.cu" target="_blank">kernel-call.cu</a><br>
<br>
./kernel-call<br>
Using CUDA device #0<br>
</div>42 == 0<br>
<br>
clang++ --version<br>
clang version 3.2 (<a href="http://llvm.org/git/clang.git" target="_blank">http://llvm.org/git/clang.git</a> f1492f970c7c6eb85dc18f13fb864b185bed1d23) (<a href="http://llvm.org/git/llvm.git" target="_blank">http://llvm.org/git/llvm.git</a> cba91230c0beef79e5042d8e983198b26aac5616)<br>

Target: x86_64-unknown-linux-gnu<br>
Thread model: posix<br></blockquote><div><br></div><div>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.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
Peter<br>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div><br>