cubecl-wgpu 0.11.0-pre.3

WGPU runtime for the CubeCL
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use cubecl_ir::prelude::*;
use pliron::{common_traits::Named, identifier::Identifier};

pub trait WgslValue {
    fn name(&self, ctx: &Context) -> Identifier;
    fn fmt_left(&self, ctx: &Context) -> String;
}

impl WgslValue for Value {
    fn name(&self, ctx: &Context) -> Identifier {
        self.unique_name(ctx)
    }

    fn fmt_left(&self, ctx: &Context) -> String {
        let name = self.name(ctx);
        format!("let {}", name)
    }
}