cubecl-wgpu 0.11.0

WGPU runtime for the CubeCL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use cubecl_ir::dialect::synchronization::{SyncOp, SyncScope};

use crate::compiler::wgsl::to_wgsl::{wasm_inventory_root, wgsl_op};

wasm_inventory_root!(SyncOp);

wgsl_op!(SyncOp, |op, ctx| {
    match op.scope(ctx).0 {
        SyncScope::Plane | SyncScope::Cube => "workgroupBarrier();\n".into(),
        // The storage half is all WGSL can say across workgroups, and the workgroup
        // barrier is the cube scope this one contains.
        SyncScope::Device => "storageBarrier();\nworkgroupBarrier();\n".into(),
        SyncScope::Unit => "".into(),
    }
});