cubecl_core/codegen/
compiler.rs1use crate::ir::{Elem, KernelDefinition};
2use cubecl_runtime::ExecutionMode;
3use std::fmt::Display;
4
5pub trait CompilerRepresentation: Display {
7 fn shared_memory_size(&self) -> usize;
9}
10
11pub trait Compiler: Sync + Send + 'static + Clone + Default + core::fmt::Debug {
13 type Representation: CompilerRepresentation;
15 type CompilationOptions: Send + Default + core::fmt::Debug;
16
17 fn compile(
19 kernel: KernelDefinition,
20 compilation_options: &Self::CompilationOptions,
21 mode: ExecutionMode,
22 ) -> Self::Representation;
23 fn elem_size(elem: Elem) -> usize;
25 fn max_shared_memory_size() -> usize;
27}