Compile CUDA using the LLVM backend
We can compile CUDA to PTX using the LLVM backend
llc
produces PTX files without complaining.
Merge request reports
Activity
OK, apparently one has to mark pointers to be in address space (1) and functions as kernels https://llvm.org/docs/NVPTXUsage.html#marking-functions-as-kernels
Edited by Stephan Seitzadded 1 commit
- ca9c30ea - llvm: Use addressspace 1 (global memory) for nvvm_target
added 1 commit
- df7f4a7b - llvm: Mark CUDA kernels and load/call resulting ptx with pycuda
Update: address space 1 is now used for device pointers and kernel functions are now correctly marked. Loading the generated PTX with pycuda now yields the same results as numpy.
TODO: change hard-codedlld-10
to generic name of binary.Test is failing because
lcc
is not installed. Numba uses CUDA's nvvm library instead of llvm's lcc. They need to perform some hacks to convert the IR to an older IR version nvcc uses.Edited by Stephan Seitzadded 2 commits
added 5 commits
- a526fe47 - Make compilation to PTX work (loading of function is WIP)
- 2e6f3efe - llvm: Use addressspace 1 (global memory) for nvvm_target
- a57a164a - llvm: Mark CUDA kernels and load/call resulting ptx with pycuda
- 8d22fddf - llvm: Add llc to pystencils' config
- 23e8e04b - Skip llvm cuda compilation if llc not in $PATH
Toggle commit listmentioned in commit 6d875789