cubecl_core/codegen/
compiler.rs1use cubecl_common::ExecutionMode;
2
3use crate::{compute::KernelDefinition, ir::Elem};
4
5pub trait Compiler: Sync + Send + 'static + Clone + core::fmt::Debug {
7 type Representation: core::fmt::Display;
9 type CompilationOptions: Send + Default + core::fmt::Debug;
10
11 fn compile(
13 &mut self,
14 kernel: KernelDefinition,
15 compilation_options: &Self::CompilationOptions,
16 mode: ExecutionMode,
17 ) -> Self::Representation;
18 fn elem_size(&self, elem: Elem) -> usize;
20
21 fn extension(&self) -> &'static str;
24}
25
26#[derive(Clone, Debug, Default)]
28pub struct WgpuCompilationOptions {
29 pub supports_fp_fast_math: bool,
30 pub supports_u64: bool,
31}