Enum ha_ndarray::host::Host

source ·
pub enum Host {
    Stack(Stack),
    Heap(Heap),
}

Variants§

§

Stack(Stack)

§

Heap(Heap)

Trait Implementations§

source§

impl Clone for Host

source§

fn clone(&self) -> Host

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: CType> Constant<T> for Host

§

type Buffer = Buffer<T>

The type of buffer use by this platform
source§

fn constant(&self, value: T, size: usize) -> Result<Self::Buffer, Error>

Construct a new buffer filled with a single value.
source§

impl<T: CType> Construct<T> for Host

§

type Range = Linear<T>

source§

fn range( self, start: T, stop: T, size: usize ) -> Result<AccessOp<Self::Range, Self>, Error>

source§

impl<T: CType> Convert<T> for Host

§

type Buffer = Buffer<T>

The type of buffer use by this platform
source§

fn convert(&self, buffer: BufferConverter<'_, T>) -> Result<Self::Buffer, Error>

source§

impl Debug for Host

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<L, R, T> ElementwiseBoolean<L, R, T> for Host
where L: Access<T>, R: Access<T>, T: CType,

§

type Op = Dual<L, R, T, u8>

source§

fn and(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn or(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn xor(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<A: Access<T>, T: CType> ElementwiseBooleanScalar<A, T> for Host

§

type Op = Scalar<A, T, u8>

source§

fn and_scalar( self, left: A, right: T ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn or_scalar(self, left: A, right: T) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn xor_scalar( self, left: A, right: T ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<A: Access<IT>, IT: CType, OT: CType> ElementwiseCast<A, IT, OT> for Host

§

type Op = Cast<A, IT, OT>

source§

fn cast(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<L, R, T> ElementwiseCompare<L, R, T> for Host
where L: Access<T>, R: Access<T>, T: CType,

§

type Op = Dual<L, R, T, u8>

source§

fn eq(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn ge(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn gt(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn le(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn lt(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn ne(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<L, R, T> ElementwiseDual<L, R, T> for Host
where L: Access<T>, R: Access<T>, T: CType,

§

type Op = Dual<L, R, T, T>

source§

fn add(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn div(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn log(self, arg: L, base: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn mul(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn pow(self, arg: L, exp: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn rem(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn sub(self, left: L, right: R) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<A: Access<T>, T: Float> ElementwiseNumeric<A, T> for Host

§

type Op = Unary<A, T, u8>

source§

fn is_inf(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn is_nan(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<A: Access<T>, T: CType> ElementwiseScalar<A, T> for Host

§

type Op = Scalar<A, T, T>

source§

fn add_scalar( self, left: A, right: T ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn div_scalar( self, left: A, right: T ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn log_scalar(self, arg: A, base: T) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn mul_scalar( self, left: A, right: T ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn pow_scalar(self, arg: A, exp: T) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn rem_scalar( self, left: A, right: T ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn sub_scalar( self, left: A, right: T ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<A: Access<T>, T: CType> ElementwiseScalarCompare<A, T> for Host

§

type Op = Scalar<A, T, u8>

source§

fn eq_scalar(self, left: A, right: T) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn ge_scalar(self, left: A, right: T) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn gt_scalar(self, left: A, right: T) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn le_scalar(self, left: A, right: T) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn lt_scalar(self, left: A, right: T) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn ne_scalar(self, left: A, right: T) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<A: Access<T>, T: CType> ElementwiseTrig<A, T> for Host

§

type Op = Unary<A, T, <T as CType>::Float>

source§

fn sin(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn asin(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn sinh(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn cos(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn acos(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn cosh(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn tan(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn atan(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn tanh(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<A: Access<T>, T: CType> ElementwiseUnary<A, T> for Host

§

type Op = Unary<A, T, T>

source§

fn abs(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn exp(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn ln(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn round(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<A: Access<T>, T: CType> ElementwiseUnaryBoolean<A, T> for Host

§

type Op = Unary<A, T, u8>

source§

fn not(self, access: A) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<A: Access<IT>, IT: CType, OT: CType> Enqueue<Host, OT> for Cast<A, IT, OT>

§

type Buffer = Buffer<OT>

source§

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

source§

impl<L, R, IT, OT> Enqueue<Host, OT> for Dual<L, R, IT, OT>
where L: Access<IT>, R: Access<IT>, IT: CType, OT: CType,

§

type Buffer = Buffer<OT>

source§

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

source§

impl<A, IT, OT> Enqueue<Host, OT> for Scalar<A, IT, OT>
where A: Access<IT>, IT: CType, OT: CType,

§

type Buffer = Buffer<OT>

source§

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

source§

impl<A, IT, OT> Enqueue<Host, OT> for Unary<A, IT, OT>
where A: Access<IT>, IT: CType, OT: CType,

§

type Buffer = Buffer<OT>

source§

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

source§

impl<A, L, R, T> Enqueue<Host, T> for Cond<A, L, R, T>
where A: Access<u8>, L: Access<T>, R: Access<T>, T: CType,

§

type Buffer = Buffer<T>

source§

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

source§

impl<T: CType> Enqueue<Host, T> for Linear<T>

§

type Buffer = Buffer<T>

source§

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

source§

impl<A: Access<T>, T: CType> Enqueue<Host, T> for MatDiag<A, T>

§

type Buffer = Buffer<T>

source§

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

source§

impl<L, R, T> Enqueue<Host, T> for MatMul<L, R, T>
where L: Access<T>, R: Access<T>, T: CType,

§

type Buffer = Buffer<T>

source§

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

source§

impl<A: Access<T>, T: CType> Enqueue<Host, T> for Reduce<A, T>

§

type Buffer = Buffer<T>

source§

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

source§

impl<A: Access<T>, T: CType> Enqueue<Host, T> for Slice<A, T>

§

type Buffer = Buffer<T>

source§

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

source§

impl<A: Access<T>, T: CType> Enqueue<Host, T> for View<A, T>

§

type Buffer = Buffer<T>

source§

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

source§

impl Enqueue<Host, f32> for RandomNormal

§

type Buffer = Buffer<f32>

source§

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

source§

impl Enqueue<Host, f32> for RandomUniform

§

type Buffer = Buffer<f32>

source§

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

source§

impl From<Heap> for Host

source§

fn from(heap: Heap) -> Self

Converts to this type from the input type.
source§

impl From<Host> for Platform

source§

fn from(host: Host) -> Self

Converts to this type from the input type.
source§

impl From<Stack> for Host

source§

fn from(stack: Stack) -> Self

Converts to this type from the input type.
source§

impl<A, L, R, T> GatherCond<A, L, R, T> for Host
where A: Access<u8>, L: Access<T>, R: Access<T>, T: CType,

§

type Op = Cond<A, L, R, T>

source§

fn cond( self, cond: A, then: L, or_else: R ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<L, R, T> LinAlgDual<L, R, T> for Host
where L: Access<T>, R: Access<T>, T: CType,

§

type Op = MatMul<L, R, T>

source§

fn matmul( self, left: L, right: R, dims: [usize; 4] ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<A: Access<T>, T: CType> LinAlgUnary<A, T> for Host

§

type Op = MatDiag<A, T>

source§

fn diag( self, access: A, batch_size: usize, dim: usize ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl PartialEq for Host

source§

fn eq(&self, other: &Host) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PlatformInstance for Host

source§

fn select(size_hint: usize) -> Self

Select a specific sub-platform based on data size.
source§

impl Random for Host

§

type Normal = RandomNormal

§

type Uniform = RandomUniform

source§

fn random_normal( self, size: usize ) -> Result<AccessOp<Self::Normal, Self>, Error>

source§

fn random_uniform( self, size: usize ) -> Result<AccessOp<Self::Uniform, Self>, Error>

source§

impl<A: Access<IT>, IT: CType, OT: CType> ReadValue<Host, OT> for Cast<A, IT, OT>

source§

fn read_value(&self, offset: usize) -> Result<OT, Error>

source§

impl<L, R, IT, OT> ReadValue<Host, OT> for Dual<L, R, IT, OT>
where L: Access<IT>, R: Access<IT>, IT: CType, OT: CType,

source§

fn read_value(&self, offset: usize) -> Result<OT, Error>

source§

impl<A, IT, OT> ReadValue<Host, OT> for Scalar<A, IT, OT>
where A: Access<IT>, IT: CType, OT: CType,

source§

fn read_value(&self, offset: usize) -> Result<OT, Error>

source§

impl<A, IT, OT> ReadValue<Host, OT> for Unary<A, IT, OT>
where A: Access<IT>, IT: CType, OT: CType,

source§

fn read_value(&self, offset: usize) -> Result<OT, Error>

source§

impl<A, L, R, T> ReadValue<Host, T> for Cond<A, L, R, T>
where A: Access<u8>, L: Access<T>, R: Access<T>, T: CType,

source§

fn read_value(&self, offset: usize) -> Result<T, Error>

source§

impl<T: CType> ReadValue<Host, T> for Linear<T>

source§

fn read_value(&self, offset: usize) -> Result<T, Error>

source§

impl<A: Access<T>, T: CType> ReadValue<Host, T> for MatDiag<A, T>

source§

fn read_value(&self, offset: usize) -> Result<T, Error>

source§

impl<L, R, T> ReadValue<Host, T> for MatMul<L, R, T>
where L: Access<T>, R: Access<T>, T: CType,

source§

fn read_value(&self, _offset: usize) -> Result<T, Error>

source§

impl<A: Access<T>, T: CType> ReadValue<Host, T> for Reduce<A, T>

source§

fn read_value(&self, offset: usize) -> Result<T, Error>

source§

impl<A: Access<T>, T: CType> ReadValue<Host, T> for Slice<A, T>

source§

fn read_value(&self, offset: usize) -> Result<T, Error>

source§

impl<A: Access<T>, T: CType> ReadValue<Host, T> for View<A, T>

source§

fn read_value(&self, offset: usize) -> Result<T, Error>

source§

impl ReadValue<Host, f32> for RandomNormal

source§

fn read_value(&self, _offset: usize) -> Result<f32, Error>

source§

impl ReadValue<Host, f32> for RandomUniform

source§

fn read_value(&self, _offset: usize) -> Result<f32, Error>

source§

impl<A: Access<T>, T: CType> ReduceAll<A, T> for Host

source§

fn all(self, access: A) -> Result<bool, Error>

source§

fn any(self, access: A) -> Result<bool, Error>

source§

fn max(self, access: A) -> Result<T, Error>

source§

fn min(self, access: A) -> Result<T, Error>

source§

fn product(self, access: A) -> Result<T, Error>

source§

fn sum(self, access: A) -> Result<T, Error>

source§

impl<A: Access<T>, T: CType> ReduceAxes<A, T> for Host

§

type Op = Reduce<A, T>

source§

fn max( self, access: A, stride: usize ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn min( self, access: A, stride: usize ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn product( self, access: A, stride: usize ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

fn sum( self, access: A, stride: usize ) -> Result<AccessOp<Self::Op, Self>, Error>

source§

impl<'a, A, T> Transform<A, T> for Host
where A: Access<T>, T: CType,

§

type Broadcast = View<A, T>

§

type Slice = Slice<A, T>

§

type Transpose = View<A, T>

source§

fn broadcast( self, access: A, shape: Shape, broadcast: Shape ) -> Result<AccessOp<Self::Broadcast, Self>, Error>

source§

fn slice( self, access: A, shape: &[usize], range: Range ) -> Result<AccessOp<Self::Slice, Self>, Error>

source§

fn transpose( self, access: A, shape: Shape, permutation: Axes ) -> Result<AccessOp<Self::Transpose, Self>, Error>

source§

impl<A, T> Write<Host, T> for Slice<A, T>
where T: CType, A: AccessMut<T>,

source§

fn write<'a>(&mut self, data: BufferConverter<'a, T>) -> Result<(), Error>

source§

fn write_value(&mut self, value: T) -> Result<(), Error>

source§

fn write_value_at(&mut self, offset: usize, value: T) -> Result<(), Error>

source§

impl Copy for Host

source§

impl Eq for Host

source§

impl StructuralEq for Host

source§

impl StructuralPartialEq for Host

Auto Trait Implementations§

§

impl RefUnwindSafe for Host

§

impl Send for Host

§

impl Sync for Host

§

impl Unpin for Host

§

impl UnwindSafe for Host

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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V