<div dir="ltr"><div>adding `-emit-llvm` causes ir to be emitted, instead of ptx.  However, it's only emitting the host-side ir, and I need device side ir.  (Well... I need both, but device side is pretty high priority...). Currently I'm doing:<br><br>clang++-3.8 -I/usr/local/cuda-7.5/include <a href="http://llvm-sample.cu">llvm-sample.cu</a> -emit-llvm -S -o llvm-sample.ll<br><br></div>How to emit device-side ir?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 26, 2016 at 3:27 PM, Hugh Perkins <span dir="ltr"><<a href="mailto:hughperkins@gmail.com" target="_blank">hughperkins@gmail.com</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"><div>How to use llvm to compile CUDA to IR?<br><br></div>I have got as far as llvm to ptx, ie/eg:<br><br>clang++-3.8 -I/usr/local/cuda-7.5/include <a href="http://llvm-sample.cu" target="_blank">llvm-sample.cu</a>  -S -o llvm-sample.ll<br><div><br></div><div>(except the ".ll" is actually ptx...)<br></div><br></div>
</blockquote></div><br></div>