Skip to main content

ComputeKernel

Trait ComputeKernel 

Source
pub trait ComputeKernel {
    // Required methods
    fn name(&self) -> &str;
    fn execute(
        &self,
        inputs: &[&[f64]],
        outputs: &mut [Vec<f64>],
        work_size: usize,
    );
}
Expand description

Trait for a compute kernel that can be dispatched on a backend.

Required Methods§

Source

fn name(&self) -> &str

Human-readable name of this kernel.

Source

fn execute(&self, inputs: &[&[f64]], outputs: &mut [Vec<f64>], work_size: usize)

Execute the kernel over work_size work items.

  • inputs – read-only input slices.
  • outputs – mutable output vectors (pre-allocated by the caller).
  • work_size – number of logical work items.

Implementors§