Skip to main content

KernelIrError

Type Alias KernelIrError 

Source
pub type KernelIrError = KernelError;
Expand description

Backward-compatible name for KernelError in IR APIs.

Aliased Type§

pub enum KernelIrError {
    Empty,
    RootOutOfBounds {
        root: usize,
        len: usize,
    },
    GradientOutOfBounds {
        output: usize,
        len: usize,
    },
    EmptyCacheOutputs,
    CacheOutputOutOfBounds {
        output: usize,
        len: usize,
    },
    GradientKindMismatch {
        output: usize,
        actual: KernelValueKind,
    },
    InvalidOperand {
        value: usize,
        operand: usize,
    },
    EmptyOperands {
        value: usize,
        operation: &'static str,
    },
    KindMismatch {
        value: usize,
        expected: KernelValueKind,
        actual: KernelValueKind,
    },
    ClassMismatch {
        value: usize,
        expected: KernelValueClass,
        actual: KernelValueClass,
    },
    InvalidShape {
        value: usize,
        operation: &'static str,
        message: String,
    },
}

Variants§

§

Empty

The IR contained no values.

§

RootOutOfBounds

The scalar root identifier was outside the value array.

Fields

§root: usize

Invalid root index.

§len: usize

Number of IR values.

§

GradientOutOfBounds

A gradient output identifier was outside the value array.

Fields

§output: usize

Invalid output index.

§len: usize

Number of IR values.

§

EmptyCacheOutputs

A cache kernel had no outputs.

§

CacheOutputOutOfBounds

A cache output identifier was outside the value array.

Fields

§output: usize

Invalid output index.

§len: usize

Number of IR values.

§

GradientKindMismatch

A gradient output was not real-valued.

Fields

§output: usize

Output index.

§actual: KernelValueKind

Actual output kind.

§

InvalidOperand

An instruction referenced a value that did not precede it.

Fields

§value: usize

Index of the invalid instruction.

§operand: usize

Invalid operand index.

§

EmptyOperands

An instruction requiring operands was empty.

Fields

§value: usize

Index of the invalid instruction.

§operation: &'static str

Operation being validated.

§

KindMismatch

A value’s declared kind did not match its instruction.

Fields

§value: usize

Index of the invalid value.

§expected: KernelValueKind

Kind produced by the instruction.

§actual: KernelValueKind

Declared kind.

§

ClassMismatch

A value’s declared evaluation class did not match its dependencies.

Fields

§value: usize

Index of the invalid value.

§expected: KernelValueClass

Class required by the dependencies.

§actual: KernelValueClass

Declared class.

§

InvalidShape

Operand shapes were incompatible with an instruction.

Fields

§value: usize

Index of the invalid value.

§operation: &'static str

Operation being validated.

§message: String

Description of the incompatibility.