Repository navigation
SpawnDev.ILGPU v2.0.0
SpawnDev.ILGPU v2.0.0 — First Stable Release
Run ILGPU kernels in the browser — on the GPU, across threads, or on the CPU.
SpawnDev.ILGPU v2.0.0 is the first stable release of this library, the successor to SpawnDev.ILGPU.WebGPU which only supported a single WebGPU backend. Version 2.0.0 brings four full compute backends, automatic device selection, and 360+ tests — all running entirely in the browser via Blazor WebAssembly.
What's New in 2.0.0
Four Compute Backends
| Backend | Executes on | Performance |
|---|---|---|
| WebGPU | GPU via WGSL transpilation | ⚡⚡⚡ Fastest |
| Wasm | Web Workers via native WebAssembly binary | ⚡⚡ Fast |
| Workers | Web Workers via JavaScript transpilation | ⚡ Moderate |
| CPU | Main thread via .NET runtime | 🐢 Fallback |
Automatic Backend Selection
Call CreatePreferredAcceleratorAsync() and the library picks the best available backend: WebGPU → Wasm → Workers → CPU.
Key Features
- WGSL transpilation — C# ILGPU kernels compiled to WebGPU Shading Language for GPU execution
- Wasm compilation — Kernels compiled to native WebAssembly binary modules for near-native performance
- 64-bit emulation — Full
double(f64) andlong(i64) support via software emulation on WebGPU - WebGPU extension auto-detection — Probes adapter for
shader-f16,subgroups,timestamp-queryand enables them automatically - Subgroup operations —
Group.BroadcastandWarp.Shufflesupported when the browser exposes thesubgroupsextension - Multi-worker dispatch — Wasm and Workers backends distribute work across all available CPU cores
- Shared memory & atomics — Workgroup memory, barriers, and atomic operations across backends
- No native dependencies — Pure C#, powered by SpawnDev.BlazorJS
360+ Tests
Comprehensive coverage across all backends: memory, indexing, arithmetic, bitwise, math functions, atomics, control flow, structs, type casting, 64-bit emulation, GPU patterns, shared memory, broadcast & subgroups, and more.
Interactive Demo
Try the live demo featuring a real-time Fractal Explorer that lets you switch between all four backends and compare performance.
Installation
dotnet add package SpawnDev.ILGPUBreaking Changes from SpawnDev.ILGPU.WebGPU
This package replaces SpawnDev.ILGPU.WebGPU. Key differences:
- Namespace:
SpawnDev.ILGPU(wasSpawnDev.ILGPU.WebGPU) - Multiple backends: WebGPU is no longer the only option — Wasm, Workers, and CPU backends are included
- Unified API:
Context.CreateAsync()with builder pattern for all backends