<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 class=""><i><b><span class="">llvm-link</span><span class=""> axpy-sm_30.bc cuda_hooks-sm_30.bc -o inst_axpy-sm_30.bc</span></b></i></p><p class=""><span class=""><i><b>llc inst_axpy-sm_30.bc -o axpy-sm_30.s</b></i></span></p><p class=""><span class=""><i><b>
</b></i></span></p><p class=""><span class=""><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 class="">However, I got the following error from ptxas:</p><p class=""><span class=""><b>ptxas axpy-sm_30.s, line 106; error : Duplicate definition of function '_ZL21__nvvm_reflect_anchorv'</b></span></p><p class=""><span class=""><b>ptxas axpy-sm_30.s, line 106; fatal : Parsing error near '.2': syntax error</b></span></p><p class="">
</p><p class=""><span class=""><b>ptxas fatal : Ptx assembly aborted due to errors</b></span></p><p class="">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><p class=""><br></p><p class="">Thanks!</p><p class="">yuanfeng </p><p class=""><span class=""><b><br></b></span></p></div><div class="gmail_extra"><br><br></div></div>