oxicuda-webgpu
Part of the OxiCUDA ecosystem — Pure Rust CUDA replacement for the COOLJAPAN ecosystem.
Overview
oxicuda-webgpu is the cross-platform GPU compute backend for OxiCUDA, targeting Vulkan, Metal, Direct3D 12, and the browser WebGPU API from a single Rust crate via wgpu. It implements the ComputeBackend trait from oxicuda-backend and provides a WebGpuBackend with a pooled buffer allocator and a WGSL shader generator for common kernels such as GEMM, element-wise ops, and reductions.
Features
- Cross-platform — Single backend targets Vulkan (Linux/Windows), Metal (macOS/iOS), Direct3D 12 (Windows), and browser WebGPU via
wgpu - WGSL shader generation — The
shadermodule generates WGSL source strings at runtime for GEMM, element-wise, and reduction kernels - Buffer pool —
WebGpuMemoryManagermaintains au64handle →wgpu::Buffermap for efficient allocation and reuse - Backend abstraction — Implements
oxicuda-backend'sComputeBackendfor interoperability with the rest of the OxiCUDA ecosystem - Pure Rust — Zero C/Fortran in the default feature set;
wgpuhandles all native API calls
Architecture
WebGpuBackend (implements ComputeBackend)
│
WebGpuDevice ← wgpu Instance + Adapter + Device + Queue
│
WebGpuMemoryManager ← buffer pool (u64 handle → wgpu::Buffer)
Usage
Add to your Cargo.toml:
[]
= "0.1.3"
use WebGpuBackend;
use ComputeBackend;
let mut backend = new;
backend.init.expect;
// Allocate 1 KiB on the GPU
let ptr = backend.alloc.expect;
backend.free.expect;
Status
- Version: 0.1.3 (2026-04-17)
- Tests: 91 passing
License
Apache-2.0 — © 2026 COOLJAPAN OU (Team KitaSan)