I get the idea of added abstraction, but do think it becomes a bit jack-of-all-tradesey.
I get the idea of added abstraction, but do think it becomes a bit jack-of-all-tradesey.
We do that all the time - there are lots of code that chooses optimal code paths depending on runtime environment or which ISA extensions are available.
Commendable effort, however just like people forget languages are ecosystems, they tend to forget APIs are ecosystems as well.
Everything is an abstraction and choosing the right level of abstraction for your usecase is a tradeoff between your engineering capacities and your performance needs.
During the build, build.rs uses rustc_codegen_nvvm to compile the GPU kernel to PTX.
The resulting PTX is embedded into the CPU binary as static data.
The host code is compiled normally.https://github.com/Rust-GPU/Rust-CUDA/blob/aa7e61512788cc702...
The fact that different hardware has different features is a good thing.
In any case, ideally, the level of abstraction would be higher, with little application logic requiring GPU architecture awareness.
You get to pull no_std Rust crates and they go to GPU instead of having to convert them to C++
My abstractions though are probably best served by Pytorch and Julia so Rust is just a waste of time, FOR ME.
If your program is written in rust, use an abstraction like Cudarc to send and receive data from the GPU. Write normal CUDA kernels.
I think not.
I believe GPUs are the future of computing. I think the tooling, languages, and ecosystems of GPUs are very bad compared to CPUs. Partially because they are newer, partially because they are different, and partially because for some reason the expectations are so low. So I intend to upset the status quo.
https://github.com/Rust-GPU/Rust-CUDA/blob/main/guide/src/fe...
I think open source alternatives will come in time, but it's a lot.