GPU resource interop + OpenCL and CUDA backends #24
Replies: 3 comments 1 reply
-
Hey! Thanks for the suggestion, let me think about it 😄 |
Beta Was this translation helpful? Give feedback.
-
Hi! Sorry for the slow reply, it's been a busy month. Right now I have 2 ideas about this:
Personally, I like the 2nd option, and more now that I read that async trait are about to be stabilized 😄. Anyway, I would like some input here haha Answering to question more specifically, I'll be fine adding this if |
Beta Was this translation helpful? Give feedback.
-
I would go with option 2 as well. Would you be interested to refactor the crate with async traits (I believe Rust 1.75 comes out Dec 28th), and just have the wgpu backend implemented like it's now? I would be able to then implement CUDA and OpenCL backends and provide a PR. In my app I currently do something similar to 1., which is to create a wgpu texture on Vulkan which is backed by CUDA memory, and this works to process CUDA buffers, but it's not ideal since it involves data copy (on device, but still), so I would like to have pure CUDA backend which can process buffers directly. Of course I would leave the possibility to process CUDA buffers on wgpu, if you don't want to write separate CUDA kernel and you're ok with that extra copy. I'll be aiming to have the CUDA backend done entirely dynamically using |
Beta Was this translation helpful? Give feedback.
-
Hi :)
Would you be open to contribution of OpenCL and CUDA backends to
gpgpu-rs
and also a way to use GPU resources directly instead of CPU buffers as inputs? I like the API ofgpgpu-rs
but I basically need to process all possible GPU resources. I have most of the interops implemented already here inwgpu-interop*.rs
, so it would be mostly a matter of refactoring that intogpgpu-rs
crate, or maybe a new separate crate which then can be used here.Basically what I envision is to be able to provide the input/output as enum like this:
and add
Shader::from_cuda_file
andShader::from_opencl_file
I can take care of all implementation and create a pull request, but I wanted to get your input first to see if you're open to such contribution. If not, I'll have to create a new crate
Beta Was this translation helpful? Give feedback.
All reactions