Struct ComputeFn

Source
pub struct ComputeFn { /* private fields */ }
Expand description

An instance of a compute function holding the implementation vtable and a set of registered compute kernels.

Implementations§

Source§

impl ComputeFn

Source

pub fn new(id: ArcRef<str>, vtable: ArcRef<dyn ComputeFnVTable>) -> Self

Create a new compute function from the given ComputeFnVTable.

Source

pub fn id(&self) -> &ArcRef<str>

Returns the string identifier of the compute function.

Source

pub fn register_kernel(&self, kernel: ArcRef<dyn Kernel>)

Register a kernel for the compute function.

Source

pub fn invoke(&self, args: &InvocationArgs<'_>) -> VortexResult<Output>

Invokes the compute function with the given arguments.

Source

pub fn return_dtype(&self, args: &InvocationArgs<'_>) -> VortexResult<DType>

Compute the return type of the function given the input arguments.

Source

pub fn return_len(&self, args: &InvocationArgs<'_>) -> VortexResult<usize>

Compute the return length of the function given the input arguments.

Source

pub fn is_elementwise(&self) -> bool

Returns whether the compute function is elementwise, i.e. the output is the same shape as

Source

pub fn kernels(&self) -> Vec<ArcRef<dyn Kernel>>

Returns the compute function’s kernels.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,