Gurunath Kadam via llvm-dev
2016-Dec-21 22:29 UTC
[llvm-dev] llvm/cuda: Indentify kernel functions and optimizations
Hi, I am trying to instrument CUDA kernel functions only (llvm-3.9.0). Is there a way to identify cuda kernel functions? I see that in llvm IR for CUDA has nvvm annotations section, where kernel functions are identified for NVPTX usage. I can parse the whole IR for this kernel metadata and then proceed, but this is very clumsy. Other way is to work with cuda-device-only IR. But then I am not sure how to run this cuda-only-IR, as this contains cuda-device specific code and not rest of the host-device code. In NVPTXBaseInfo.h, the function attributes are defined, along with PROPERTY_ISKERNEL_FUNCTION. How can this be used to identify the kernel function? Thanks. -Gurunath -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161221/8cbfb680/attachment.html>
Jingyue Wu via llvm-dev
2016-Dec-21 23:13 UTC
[llvm-dev] llvm/cuda: Indentify kernel functions and optimizations
https://github.com/llvm-mirror/llvm/blob/652375a8cc49615de31fd9d424753795059185b6/lib/Target/NVPTX/NVPTXUtilities.h#L58 Does this solve your problem? On Wed, Dec 21, 2016 at 2:29 PM, Gurunath Kadam via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi, > > I am trying to instrument CUDA kernel functions only (llvm-3.9.0). > > Is there a way to identify cuda kernel functions? > > I see that in llvm IR for CUDA has nvvm annotations section, where kernel > functions are identified for NVPTX usage. I can parse the whole IR for this > kernel metadata and then proceed, but this is very clumsy. > > Other way is to work with cuda-device-only IR. But then I am not sure how > to run this cuda-only-IR, as this contains cuda-device specific code and > not rest of the host-device code. > > In NVPTXBaseInfo.h, the function attributes are defined, along > with PROPERTY_ISKERNEL_FUNCTION. How can this be used to identify the > kernel function? > > Thanks. > > -Gurunath > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161221/61525ae8/attachment.html>
Gurunath Kadam via llvm-dev
2016-Dec-21 23:35 UTC
[llvm-dev] llvm/cuda: Indentify kernel functions and optimizations
Hi Jingyue, Thank should work! :) Also, next time I will check the available resources in NVPTX before posting here! Thanks. -Gurunath On Wed, Dec 21, 2016 at 6:13 PM, Jingyue Wu <jingyue at google.com> wrote:> https://github.com/llvm-mirror/llvm/blob/652375a8cc49615de31fd9d4247537 > 95059185b6/lib/Target/NVPTX/NVPTXUtilities.h#L58 > > Does this solve your problem? > > On Wed, Dec 21, 2016 at 2:29 PM, Gurunath Kadam via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hi, >> >> I am trying to instrument CUDA kernel functions only (llvm-3.9.0). >> >> Is there a way to identify cuda kernel functions? >> >> I see that in llvm IR for CUDA has nvvm annotations section, where kernel >> functions are identified for NVPTX usage. I can parse the whole IR for this >> kernel metadata and then proceed, but this is very clumsy. >> >> Other way is to work with cuda-device-only IR. But then I am not sure how >> to run this cuda-only-IR, as this contains cuda-device specific code and >> not rest of the host-device code. >> >> In NVPTXBaseInfo.h, the function attributes are defined, along >> with PROPERTY_ISKERNEL_FUNCTION. How can this be used to identify the >> kernel function? >> >> Thanks. >> >> -Gurunath >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161221/ac2aad13/attachment.html>
Possibly Parallel Threads
- llvm/cuda: Indentify kernel functions and optimizations
- Assign different RegClasses to a virtual, register based on 'uniform' attribute?
- LLVM Pass for Instructions in Function (error
- LLVM Pass for Instructions in Function (error
- LLVM/CLANG: CUDA compilation fail for inline assembly code