Trait Compiler

Source
pub trait Compiler:
    Sync
    + Send
    + 'static
    + Clone
    + Default
    + Debug {
    type Representation: CompilerRepresentation;
    type CompilationOptions: Send + Default + Debug;

    // Required methods
    fn compile(
        kernel: KernelDefinition,
        compilation_options: &Self::CompilationOptions,
        mode: ExecutionMode,
    ) -> Self::Representation;
    fn elem_size(elem: Elem) -> usize;
    fn max_shared_memory_size() -> usize;
}
Expand description

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

Required Associated Types§

Source

type Representation: CompilerRepresentation

The representation for the compiled code.

Source

type CompilationOptions: Send + Default + Debug

Required Methods§

Source

fn compile( kernel: KernelDefinition, compilation_options: &Self::CompilationOptions, mode: ExecutionMode, ) -> Self::Representation

Compiles the kernel definition 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, in bytes

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§