pub struct WgslTranspiler {
pub shared_vars: HashMap<String, SharedVarInfo>,
/* private fields */
}Expand description
WGSL code transpiler.
Fields§
Variables that are SharedTile or SharedArray types.
Implementations§
Source§impl WgslTranspiler
impl WgslTranspiler
Sourcepub fn new_stencil(config: StencilConfig) -> Self
pub fn new_stencil(config: StencilConfig) -> Self
Create a new transpiler with stencil configuration.
Sourcepub fn new_generic() -> Self
pub fn new_generic() -> Self
Create a new transpiler without stencil configuration.
Sourcepub fn new_ring_kernel(config: RingKernelConfig) -> Self
pub fn new_ring_kernel(config: RingKernelConfig) -> Self
Create a new transpiler for ring kernel generation.
Sourcepub fn with_workgroup_size(self, x: u32, y: u32, z: u32) -> Self
pub fn with_workgroup_size(self, x: u32, y: u32, z: u32) -> Self
Set the workgroup size for generic kernels.
Sourcepub fn transpile_stencil(&mut self, func: &ItemFn) -> Result<String>
pub fn transpile_stencil(&mut self, func: &ItemFn) -> Result<String>
Transpile a stencil kernel function.
Sourcepub fn transpile_global_kernel(&mut self, func: &ItemFn) -> Result<String>
pub fn transpile_global_kernel(&mut self, func: &ItemFn) -> Result<String>
Transpile a generic (non-stencil) kernel function.
Sourcepub fn transpile_ring_kernel(
&mut self,
handler: &ItemFn,
config: &RingKernelConfig,
) -> Result<String>
pub fn transpile_ring_kernel( &mut self, handler: &ItemFn, config: &RingKernelConfig, ) -> Result<String>
Transpile a handler function into a ring kernel.