LLVM IR and Julia (As it relates to NVIDIA and CUDA)

224 views
Skip to first unread message

Krzysztof Kamieniecki

unread,
Feb 6, 2013, 2:56:01 PM2/6/13
to juli...@googlegroups.com
Is there an existing or planned representation of LLVM IR that can be manipulated by Julia? The C library that NVIDIA provides (currently in prerelease form and apparently a wrapper around the code in LLVM) does ptx generation using a reduced set of LLVM IR as its input, and I would prefer to not have to reinvent the wheel. (The resultant PTX would then be passed into my existing GPU control code).

Keno Fischer

unread,
Feb 6, 2013, 3:01:37 PM2/6/13
to juli...@googlegroups.com
It doesn't exist yet, but I think it's a good idea. 

Krzysztof Kamieniecki

unread,
Feb 14, 2013, 2:05:59 AM2/14/13
to juli...@googlegroups.com
So the more I look at this the less appealing it seems to be. At some point you end up having to rewrite the Julia Codegen code and LLVM C++ convenience classes in Julia. Then you would have to track them in a parallel development path. Not to mention what would have to be done when Julia statically compiles...

Maybe what I am looking for is a modularization the Julia's C++ JIT codegen code. The GPU (and "dangerous" CPU code with bounds checking moved to before the for loops, etc...) would then have direct access to parts of the stock Julia codegen (or access to the same LLVM library) and memory management.

The codegen modules could register requirements they have for memory allocation and then all memory allocations could meet their specific critiera (alignment, etc...). They would also be able to tag objects in memory, one use of this would be to lock arrays when they are being processed on the GPU. I think the intermediate GPU code could be kept in resources that the CPU JIT compiler would deal with, so they could be exported to libraries.
Reply all
Reply to author
Forward
0 new messages