Skip to main content

Kernel

Trait Kernel 

Source
pub trait Kernel {
    type Args<'a>: KernelArgs;

    // Required methods
    fn name(&self) -> &str;
    fn source(&self) -> &str;
    fn kernel_source(&self) -> &str;
    fn entry_point_source(&self) -> &str;

    // Provided methods
    fn id(&self) -> String { ... }
    fn entry_point_name(&self) -> String { ... }
}
Expand description

A kernel definition: its source, name, and identity.

Required Associated Types§

Source

type Args<'a>: KernelArgs

This kernel’s launch-argument tuple type.

Required Methods§

Source

fn name(&self) -> &str

This kernel’s name.

Source

fn source(&self) -> &str

This kernel’s full source (DSL + kernel body + entry point wrapper).

Source

fn kernel_source(&self) -> &str

This kernel’s body source, without the entry-point wrapper.

Source

fn entry_point_source(&self) -> &str

Returns the Rust source of the generated C-ABI entry-point wrapper function.

Provided Methods§

Source

fn id(&self) -> String

A content hash of this kernel’s source, used as a cache key.

Source

fn entry_point_name(&self) -> String

Returns the PTX symbol name for this kernel: "{name}_entry_point".

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§