-
Hello! I'm very interested in rust-gpu and was wondering if it could be used to make Rust code that can either run on GPU or CPU. Is it something that can already be done? Is there any docs/examples regarding this? Does it even make sense in practice? I'm a beginner to GPU computing but I was mainly considering using compute shaders which don't sound too different from normal CPU computations except they're heavy parallel. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can see this section and the code for this blog post: https://rust-gpu.github.io/blog/optimizing-matmul/#running-and-debugging-shaders-on-the-cpu As it runs the kernels on CPU for testing and GPU for "production". You can also check out these projects, all of which run on both GPU and CPU. Sometimes just partly for debugging, sometimes the full thing does: |
Beta Was this translation helpful? Give feedback.
You can see this section and the code for this blog post:
https://rust-gpu.github.io/blog/optimizing-matmul/#running-and-debugging-shaders-on-the-cpu
As it runs the kernels on CPU for testing and GPU for "production".
You can also check out these projects, all of which run on both GPU and CPU. Sometimes just partly for debugging, sometimes the full thing does: