You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could consider "splitting" the webgpu-native backend in 2 parts, one being autogenerated direct python bindings, and one being the translation layer to the IDL-standardized webgpu API, I documented this idea here. Idea originates from #480
We can combine the following tools to automatically generate bindings for webgpu-native:
a python script generate pyo3 bindings, using cffi to parse wgpu.h
These bindings will be more performant since they don't rely on cffi at runtime.
This would need to be done in a separate lib, that we can then depend on in wgpu-py to layer the IDL based API on top of the bindings.
We would not be able to use the binary releases of webgpu-native though; we'd have to build the bindings ourselves directly from rust source. So that's a bit of a bummer but not impossible. Because of that, we have a few choices:
fork the webgpu-native repo
depend on webgpu-native with cargo (not sure if this is realistic)
What if we go for C-API bindings instead? Then we can use the binary wgpu-native releases, and use simpler tooling (e.g. cython).
So we take the binary, the header file, and then wrap with cython? I'm not sure I know how to compile something like that. Would we dynamically link to the binary then?
It would indeed be a lot simpler to set up, that's for sure. I strongly prefer going this route if we can.
We could consider "splitting" the webgpu-native backend in 2 parts, one being autogenerated direct python bindings, and one being the translation layer to the IDL-standardized webgpu API, I documented this idea here. Idea originates from #480
We can combine the following tools to automatically generate bindings for webgpu-native:
These bindings will be more performant since they don't rely on cffi at runtime.
This would need to be done in a separate lib, that we can then depend on in wgpu-py to layer the IDL based API on top of the bindings.
We would not be able to use the binary releases of webgpu-native though; we'd have to build the bindings ourselves directly from rust source. So that's a bit of a bummer but not impossible. Because of that, we have a few choices:
There is one other project we can look at for inspiration that already autogenerates bindings for C++ here: https://github.com/eliemichel/WebGPU-Cpp/
The text was updated successfully, but these errors were encountered: