Trait ha_ndarray::ops::Op

source ·
pub trait Op: Send + Sync {
    type Out: CDatatype;

    // Required methods
    fn context(&self) -> &Context;
    fn enqueue_cpu(&self, queue: &Queue) -> Result<Vec<Self::Out>, Error>;
    fn read_value(&self, coord: &[usize]) -> Result<Self::Out, Error>;

    // Provided method
    fn enqueue(&self, queue: &Queue) -> Result<Buffer<Self::Out>, Error> { ... }
}
Expand description

An n-dimensional array Op

Required Associated Types§

source

type Out: CDatatype

The output data type of this Op

Required Methods§

source

fn context(&self) -> &Context

The execution context of this Op

source

fn enqueue_cpu(&self, queue: &Queue) -> Result<Vec<Self::Out>, Error>

Enqueue this Op on the host CPU.

source

fn read_value(&self, coord: &[usize]) -> Result<Self::Out, Error>

Read the result of this Op at a single coord.

Provided Methods§

source

fn enqueue(&self, queue: &Queue) -> Result<Buffer<Self::Out>, Error>

Enqueue this Op for execution.

Implementations on Foreign Types§

source§

impl<O: Op + ?Sized> Op for Box<O>

§

type Out = <O as Op>::Out

source§

fn context(&self) -> &Context

source§

fn enqueue_cpu(&self, queue: &Queue) -> Result<Vec<Self::Out>, Error>

source§

fn read_value(&self, coord: &[usize]) -> Result<Self::Out, Error>

source§

impl<O: Op + ?Sized> Op for Arc<O>

§

type Out = <O as Op>::Out

source§

fn context(&self) -> &Context

source§

fn enqueue_cpu(&self, queue: &Queue) -> Result<Vec<Self::Out>, Error>

source§

fn read_value(&self, coord: &[usize]) -> Result<Self::Out, Error>

Implementors§

source§

impl Op for RandomNormal

§

type Out = f32

source§

impl Op for RandomUniform

§

type Out = f32

source§

impl<A, T, L, R> Op for GatherCond<A, T, L, R>where A: NDArrayRead<DType = u8>, T: CDatatype, L: NDArrayRead<DType = T>, R: NDArrayRead<DType = T>,

§

type Out = T

source§

impl<A: NDArrayRead> Op for MatDiag<A>

§

type Out = <A as NDArray>::DType

source§

impl<A: NDArrayRead, O: CDatatype> Op for ArrayCast<A, O>

§

type Out = O

source§

impl<IT: CDatatype, OT: CDatatype, A: NDArrayRead<DType = IT>> Op for ArrayUnary<IT, OT, A>

§

type Out = OT

source§

impl<L: NDArrayRead<DType = T>, T: CDatatype> Op for ArrayBooleanScalar<L, T>

§

type Out = u8

source§

impl<T, A> Op for ArrayReduceAxes<T, A>where T: CDatatype, A: NDArrayRead<DType = T>,

§

type Out = T

source§

impl<T, L, R> Op for ArrayCompare<T, L, R>where T: CDatatype, L: NDArrayRead<DType = T>, R: NDArrayRead<DType = T>,

§

type Out = u8

source§

impl<T, L, R> Op for ArrayDualFloat<T, L, R>where T: CDatatype, L: NDArrayRead<DType = T>, R: NDArrayRead<DType = T::Float>,

§

type Out = T

source§

impl<T, L, R> Op for MatMul<T, L, R>where T: CDatatype, L: NDArrayRead<DType = T> + NDArrayTransform, R: NDArrayRead<DType = T> + NDArrayTransform, L::Slice: NDArrayMath,

§

type Out = T

source§

impl<T: CDatatype> Op for Range<T>

§

type Out = T

source§

impl<T: CDatatype, A: NDArrayRead<DType = T>> Op for ArrayCompareScalar<T, A>

§

type Out = u8

source§

impl<T: CDatatype, A: NDArrayRead<DType = T>> Op for ArrayScalar<T, A>

§

type Out = <A as NDArray>::DType

source§

impl<T: CDatatype, A: NDArrayRead<DType = T>> Op for ArrayScalarFloat<T, A>

§

type Out = T

source§

impl<T: CDatatype, L, R> Op for ArrayBoolean<T, L, R>where L: NDArrayRead<DType = T>, R: NDArrayRead<DType = T>,

§

type Out = u8

source§

impl<T: CDatatype, L: NDArrayRead<DType = T>, R: NDArrayRead<DType = T>> Op for ArrayDual<T, L, R>

§

type Out = T