<div dir="ltr"><div><div><div><div>Hi Dmitry,<br><br></div>I tried using the tool you pointed me to and run into a problem, you may be able to help.<br><br></div><div>Here is what I did:<br><br></div>- I installed (i.e., downloaded and built) LLVM 3.2 as it seems that this is the version that is compatible with the tool.<br></div>- I changed the hard-coded paths in the nvcc-llvm-ir/makefile as follows (changes are in bold)<br><br>libcicc.so: cicc.cpp<br>         g++ -g -O3 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS <b>-I/$LLVM_BUILD_DIR/include/ -I/$CUDA_5.5_BUILD_DIR/nvvm/include/</b> -fPIC $< -shared -o $@ -ldl <b>-L/$LLVM_BUILD_DIR/Release+Asserts/lib/ </b>-Wl,--start-group -lLLVMCore -lLLVMSupport -lLLVMipo -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMInstCombine -Wl,--end-group -lpthread<br><br></div><div>libnvcc.so: nvcc.cpp<br>        g++ -g -O3 -I/<b>$CUDA_5.5_BUILD_DIR</b>/nvvm/include/  -fPIC $< -shared -o $@ -ldl<br><br></div><div><br></div><div>-I noticed that some of the required header files from LLVM exists in <b>-I/$LLVM_SRC_DIR/include/  </b>and others are auto-generated into  <b>-I/$LLVM_BUILD_DIR/include/  </b>so I had to manually move them to one folder for the make to compiler properly (I moved them to the build directory).<br><br><br></div><div>-It compiles fine and both libcicc.so and libnvcc.so are generated.<br><br><br></div><div>- Finally, when I try to run 'CICC_MODIFY_UNOPT_MODULE=1 LD_PRELOAD=./libnvcc.so nvcc -arch=sm_23 <a href="http://test1.cu" target="_blank">test1.cu</a> -c -keep' , it gives a <b>Segmentation fault</b>.  <br><br></div><div>In fact doing "export LD_PRELOAD=./libnvcc.so" was enough to make the terminal Segfault with any other command !!!  (e.g., it segfault when simply doing "ls" if LD_PRELOAD is exported)<br><br></div><div>Any idea what is the problem ?  <br><br></div><div>This is my OS info:<br><br>Distributor ID:    SUSE LINUX<br>Description:    openSUSE 11.4 (x86_64)<br>Release:    11.4<br>Codename:    Celadon<br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 8, 2015 at 10:12 AM, Dmitry Mikushin <span dir="ltr"><<a href="mailto:dmitry@kernelgen.org" target="_blank">dmitry@kernelgen.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">A tool of this kind here: <a href="https://github.com/apc-llc/nvcc-llvm-ir" target="_blank">https://github.com/apc-llc/nvcc-llvm-ir</a><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2015-04-08 19:01 GMT+02:00 Ahmed ElTantawy <span dir="ltr"><<a href="mailto:ahmede@ece.ubc.ca" target="_blank">ahmede@ece.ubc.ca</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div>Hi,<br><br></div>I wanted to ask whether there is ongoing effort (or an already established tool) that enables to convert CUDA kernels (that uses CUDA specific intrinsics, e.g., threadId.x, __syncthreads(), ...) to LLVM IR. I am aware that I can do this for OpenCL with the help of libclc but I can not find something similar for CUDA.<br><br></div>Thanks<br></div>
<br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>