4 ms·
> there’s no speed to be gained by using this relative to CUDA. That is not totally true, there are two main things that can make kernels generated by this cod
by rdambrosio 5y ago
> there’s no speed to be gained by using this relative to CUDA.
That is not totally true, there are two main things that can make kernels generated by this codegen faster:
- noalias, which is the LLVM equivalent of __restrict__, CUDA can take massive advantage of noalias by using readonly cache if the pointer does not alias. If you don't believe me just take a look at nvidia's blog post: https://developer.nvidia.com/blog/cuda-pro-tip-optimize-pointer-aliasing/ https://developer.nvidia.com/blog/cuda-pro-tip-optimize-poin...
- CUDA builds all the .cu files and links the PTX of them together, this means no LTO happens by default. I do something different where i actually lazily-load every module using dependency graphs, which gives you the benefit of LTO by default. Its not perfect because right now it leaves behind a lot of dead code, but i know how to fix it.