<div dir="ltr">Moving to cfe-dev<div><br></div><div>+Art and Justin</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 13, 2016 at 1:13 PM, Gurunath Kadam via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">So for a c program we do:<div><br></div><div> clang -O3 -emit-llvm hello.c -c -o hello.bc<br></div><div><br></div><div>But how to generate an LLVM IR when working with CUDA.</div><div><br></div><div>for normal compilation:</div><div> clang++ <a href="http://axpy.cu" target="_blank">axpy.cu</a> -o axpy --cuda-gpu-arch=<GPU arch> -L<CUDA install path>/<lib64 or lib> -lcudart_static -ldl -lrt -pthread</div><div><br></div><div>I tried adding -S -emit-llvm and changed the output file name, but I keep getting following error:</div><div><br></div><div>clang++: /stor/gakadam/llvm_projects/<wbr>llvm/tools/clang/lib/Driver/<wbr>Driver.cpp:1618: virtual {anonymous}::<wbr>OffloadingActionBuilder::<wbr>DeviceActionBuilder::<wbr>ActionBuilderReturnCode {anonymous}::<wbr>OffloadingActionBuilder::<wbr>CudaActionBuilder::<wbr>getDeviceDepences(clang::<wbr>driver::OffloadAction::<wbr>DeviceDependences&, clang::driver::phases::ID, clang::driver::phases::ID, {anonymous}::<wbr>OffloadingActionBuilder::<wbr>DeviceActionBuilder::PhasesTy&<wbr>): Assertion `CurPhase < phases::Backend && "Generating single CUDA " "instructions should only occur " "before the backend phase!"' failed.<br></div><div><br></div><div>I tried several combinations but no avail!</div><div><br></div><div>Any suggestions?</div><div><br></div><div>Thank you.</div><div><br></div><div>Sincerely,</div><div>Guru</div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>