[llvm-dev] instrumenting device code with gpucc

Jingyue Wu via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 11 03:47:58 PST 2016


Looks like we are getting closer!

On Thu, Mar 10, 2016 at 5:21 PM, Yuanfeng Peng <yuanfeng.jack.peng at gmail.com
> wrote:

> Hi Jingyue,
>
> 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.
>
> 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):
>
> *llvm-link axpy-sm_30.bc cuda_hooks-sm_30.bc  -o inst_axpy-sm_30.bc*
>
> *llc inst_axpy-sm_30.bc -o axpy-sm_30.s*
>
> *"/usr/local/cuda/bin/ptxas" "-m64" "-O3" -c "--gpu-name" "sm_30"
> "--output-file" axpy-sm_30.o axpy-sm_30.s*
>
> However, I got the following error from ptxas:
>
> *ptxas axpy-sm_30.s, line 106; error   : Duplicate definition of function
> '_ZL21__nvvm_reflect_anchorv'*
>
> *ptxas axpy-sm_30.s, line 106; fatal   : Parsing error near '.2': syntax
> error*
>
> *ptxas fatal   : Ptx assembly aborted due to errors*
>
> 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?
>
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.

>
> Thanks!
>
> yuanfeng
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160311/77502182/attachment.html>


More information about the llvm-dev mailing list