<div dir="ltr">Looks like we are getting closer! <br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 10, 2016 at 5:21 PM, Yuanfeng Peng <span dir="ltr"><<a href="mailto:yuanfeng.jack.peng@gmail.com" target="_blank">yuanfeng.jack.peng@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 class="gmail_extra">Hi Jingyue,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thank you so much for the helpful response!  I didn't know that PTX assembly cannot be linked; that's likely the reason for my issue.</div><div class="gmail_extra"><br></div><div class="gmail_extra">So I did the following as you suggested(axpy-sm_30.bc is the instrumented bitcode, and cuda_hooks-sm_30.bc contains the hook functions):</div><div class="gmail_extra"><br></div><div class="gmail_extra">







<p><i><b><span>llvm-link</span><span> axpy-sm_30.bc cuda_hooks-sm_30.bc  -o inst_axpy-sm_30.bc</span></b></i></p><p><span><i><b>llc inst_axpy-sm_30.bc -o axpy-sm_30.s</b></i></span></p><p><span><i><b>








</b></i></span></p><p><span><i><b>"/usr/local/cuda/bin/ptxas" "-m64" "-O3" -c "--gpu-name" "sm_30" "--output-file" axpy-sm_30.o axpy-sm_30.s</b></i></span></p><p>However, I got the following error from ptxas:</p><p><span><b>ptxas axpy-sm_30.s, line 106; error   : Duplicate definition of function '_ZL21__nvvm_reflect_anchorv'</b></span></p><p><span><b>ptxas axpy-sm_30.s, line 106; fatal   : Parsing error near '.2': syntax error</b></span></p><p>









</p><p><span><b>ptxas fatal   : Ptx assembly aborted due to errors</b></span></p><p>Looks like some cuda function definitions are in both bitcode files which caused duplicate definition... what am I supposed to do to resolve this issue?</p></div></div></blockquote><div>Can you attach axpy-sm_30.ll and cuda_hooks-sm_30.ll? The duplication may be caused by how nvvm reflection works, but I'd like to see a concrete example.  <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><p><br></p><p>Thanks!</p><span class="HOEnZb"><font color="#888888"><p>yuanfeng </p><p><span><b><br></b></span></p></font></span></div><div class="gmail_extra"><br><br></div></div>
</blockquote></div><br></div></div>