PTX->LLVM IR

143 views
Skip to first unread message

shehanaz mahammed

unread,
Sep 9, 2015, 2:25:16 AM9/9/15
to gpuocelot
I am a newbie and I have successfully installed ocelot in ubuntu 12.04 .Is there any way to get the LLLVM IR using ocelot?

Jin Wang

unread,
Sep 9, 2015, 11:39:04 PM9/9/15
to gpuocelot
You may want to use the PTXToLLVMTranslator transformation pass. The following source code might be useful:

/your/path/to/gpuocelot/ocelot/ocelot/translator/implementation/PTXToLLVMTranslator.cpp
/your/path/to/gpuocelot/ocelot/ocelot/translator/interface/PTXToLLVMTranslator.h
/your/path/to/gpuocelot/ocelot/ocelot/translator/test/TestPTXToLLVMTranslator.cpp
/your/path/to/gpuocelot/ocelot/ocelot/translator/test/TestPTXToLLVMTranslator.h

On Wed, Sep 9, 2015 at 2:25 AM shehanaz mahammed <shehan...@gmail.com> wrote:
I am a newbie and I have successfully installed ocelot in ubuntu 12.04 .Is there any way to get the LLLVM IR using ocelot?

--
You received this message because you are subscribed to the Google Groups "gpuocelot" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gpuocelot+...@googlegroups.com.
To post to this group, send email to gpuo...@googlegroups.com.
Visit this group at http://groups.google.com/group/gpuocelot.
For more options, visit https://groups.google.com/d/optout.

shehanaz mahammed

unread,
Sep 11, 2015, 12:37:25 AM9/11/15
to gpuocelot
How can i use the PTX to LLVM IR translator provided in GpuOcelot? Should i be running the PTXToLLVMTranslator.cpp ?

Jin Wang

unread,
Sep 11, 2015, 9:54:38 AM9/11/15
to gpuocelot
After building ocelot with basic test level, i.e. "./build.py -t basic", you can run ".release_build/ocelot/TestPTXToLLVMTranslator" with appropriate parameters (query by "-h") to output LLVM IR. This test is generated from /your/path/to/gpuocelot/ocelot/ocelot/translator/test/TestPTXToLLVMTranslator.cpp.

On Fri, Sep 11, 2015 at 12:37 AM shehanaz mahammed <shehan...@gmail.com> wrote:
How can i use the PTX to LLVM IR translator provided in GpuOcelot? Should i be running the PTXToLLVMTranslator.cpp ?

--

shehanaz mahammed

unread,
Sep 14, 2015, 12:35:02 AM9/14/15
to gpuocelot
Thanks for your reply
Message has been deleted

Jin Wang

unread,
Sep 14, 2015, 11:01:06 AM9/14/15
to gpuocelot
Executing "TestPTXToLLVMTranslator -i /your/path/to/the/dir/that/contains/ptx -o" will generate corresponding llvm ir for all the PTX in the input dir in the name of "ptxfilename.kernelname.ll". These ".ll" files are also under your input dir. Please check. If you don't see them, post your ptx file and I will take a look.

On Mon, Sep 14, 2015 at 2:50 AM shehanaz mahammed <shehan...@gmail.com> wrote:
I could run the .release_build/ocelot/TestPTXToLLVMTranslator successfully .The option given in help for outputting the internal represntation of parsed file is -o. My ptx files passed the test but i am unable to get the intermediate representation with -o as parameter.


On Wednesday, September 9, 2015 at 11:55:16 AM UTC+5:30, shehanaz mahammed wrote:
I am a newbie and I have successfully installed ocelot in ubuntu 12.04 .Is there any way to get the LLLVM IR using ocelot?

--

Jin Wang

unread,
Sep 14, 2015, 11:09:51 AM9/14/15
to gpuocelot
Executing "TestPTXToLLVMTranslator -i /your/path/to/the/dir/that/contains/ptx -o" will generate corresponding llvm ir for all the PTX in the input dir in the name of "ptxfilename.kernelname.ll". These ".ll" files are also under your input dir. Please check. If you don't see them, post your ptx file and I will take a look.

shehanaz mahammed

unread,
Sep 14, 2015, 1:49:08 PM9/14/15
to gpuo...@googlegroups.com

Thank u for ur reply, same way I had executed but  i compiled cuda kernels with arch=sm_10 and was getting corresponding ptx code with arch=sm_10. When I complied cuda kernels with arch=sm_20 and then executed the ptx code using the command u mentioned, I got the correspondind LLVM IR.
Thank you.

--
You received this message because you are subscribed to a topic in the Google Groups "gpuocelot" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gpuocelot/q1GEFcfjXIs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gpuocelot+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages