Trait burn_jit::Compiler

source ·
pub trait Compiler: Sync + Send + 'static + Clone + Default + Debug {
    type Representation: Display;
    type Float: FloatElement;
    type Int: IntElement;
    type FullPrecisionCompiler: Compiler<Representation = Self::Representation, Float = f32, Int = i32>;

    // Required methods
    fn compile(shader: ComputeShader) -> Self::Representation;
    fn elem_size(elem: Elem) -> usize;
    fn max_shared_memory_size() -> usize;
}
Expand description

Compiles the gpu representation into its own representation that can be formatted into tokens.

Required Associated Types§

source

type Representation: Display

The representation for the compiled code.

source

type Float: FloatElement

The float element type used for compilation.

source

type Int: IntElement

The int element type used for compilation.

source

type FullPrecisionCompiler: Compiler<Representation = Self::Representation, Float = f32, Int = i32>

The compiler that can be used to generate full precision shaders.

Required Methods§

source

fn compile(shader: ComputeShader) -> Self::Representation

Compiles the gpu shader into the compiler’s representation.

source

fn elem_size(elem: Elem) -> usize

The size of the given element in bytes.

source

fn max_shared_memory_size() -> usize

The maximal size of a shared memory

Object Safety§

This trait is not object safe.

Implementors§