huggingface/ratchet
Minimum number of copies from `Uint8Array` to `wgpu::Buffer`
開放
#171 建立於 2024年4月18日
help wanted
倉庫指標
- 星標
- (768 顆星)
- PR 合併指標
- (30 天內沒有已合併 PR)
描述
Currently in wgpu, there is no way to create a wgpu::Buffer directly from Uint8Array.
This means that our tensor data does something like this:
IndexedDB -> Uint8Array -> Vec<u8> ~~> Uint8Array -> WebGPU
Judging by this: https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer
I think the optimal is:
IndexedDB -> Uint8Array -> WebGPU
Reference: https://github.com/gfx-rs/wgpu/blob/trunk/wgpu/src/backend/webgpu.rs#L1821