burn/crates/burn-wgpu
Nathaniel Simard 886a1de235
Refactor/burn compute (#1580)
2024-04-23 13:05:15 -04:00
..
src Refactor/burn compute (#1580) 2024-04-23 13:05:15 -04:00
Cargo.toml Bump next version of Burn to 0.14.0 (#1618) 2024-04-12 17:14:45 -04:00
LICENSE-APACHE Update licenses symlinks (#1613) 2024-04-12 14:43:58 -04:00
LICENSE-MIT Update licenses symlinks (#1613) 2024-04-12 14:43:58 -04:00
README.md [refactor] Move burn crates to their own crates directory (#1336) 2024-02-20 13:57:55 -05:00

README.md

Burn WGPU Backend

Burn WGPU backend

Current Crates.io Version license

This crate provides a WGPU backend for Burn using the wgpu.

The backend supports Vulkan, Metal, DirectX11/12, OpenGL, WebGPU.

Usage Example

#[cfg(feature = "wgpu")]
mod wgpu {
    use burn_autodiff::Autodiff;
    use burn_wgpu::{AutoGraphicsApi, Wgpu, WgpuDevice};
    use mnist::training;

    pub fn run() {
        let device = WgpuDevice::default();
        training::run::<Autodiff<Wgpu<AutoGraphicsApi, f32, i32>>>(device);
    }
}

Configuration

You can set BURN_WGPU_MAX_TASKS to a positive integer that determines how many computing tasks are submitted in batches to the graphics API.

Platform Support

Option CPU GPU Linux MacOS Windows Android iOS WASM
Metal No Yes No Yes No No Yes No
Vulkan Yes Yes Yes Yes Yes Yes Yes No
OpenGL No Yes Yes Yes Yes Yes Yes No
WebGpu No Yes No No No No No Yes
Dx11/Dx12 No Yes No No Yes No No No