3 ms·
Does this mean we could hook Cython up to NVPTX as the backend? I've always thought it weird that I'm writing all my code in this language that compiles to C++
by syllogism 9y ago
Does this mean we could hook Cython up to NVPTX as the backend?
I've always thought it weird that I'm writing all my code in this language that compiles to C++, with semantics for any type declaration etc...And then I write chunks of code in strings, like an animal.
- nicwilson 9y agoIDK about Cython, but I remember a blog post using Python's AST reflection to jit to LLVM ->NVPTX -> PTX. It's relatively simple to do, I've done it for LDC/D/DCompute[1,2,3]. It's a little tricker if you want to be able to express shared memory surfaces & textures, but it should still be doable. [1] https://github.com/ldc-developers/ldc https://github.com/ldc-developers/ldc [2] dlang.org [3] http://github.com/libmir/dcompute http://github.com/libmir/dcompute
- jlebar 9y agoRunning code on the GPU usually isn't as easy as "compile and go", but...yeah, if you can emit LLVM IR, you can get PTX which you can run on the GPU.