Enum Platform

Source
pub enum Platform {
    Host(Host),
}
Expand description

The global platform, responsible for delegating to specific hardware platforms

Variants§

§

Host(Host)

Trait Implementations§

Source§

impl Clone for Platform

Source§

fn clone(&self) -> Platform

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 Platform

Source§

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 Platform

Source§

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 Platform

Source§

type Buffer = Buffer<T>

The type of buffer use by this platform
Source§

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

Source§

impl Debug for Platform

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 Platform
where L: Access<T>, R: Access<T>, T: CType,

Source§

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 Platform

Source§

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 Platform

Source§

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 Platform
where L: Access<T>, R: Access<T>, T: CType,

Source§

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 Platform
where L: Access<T>, R: Access<T>, T: CType,

Source§

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 Platform

Source§

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 Platform

Source§

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 Platform

Source§

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 Platform

Source§

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 Platform

Source§

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 Platform

Source§

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<Platform, OT> for Cast<A, IT, OT>

Source§

type Buffer = Buffer<OT>

Source§

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

Source§

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

Source§

type Buffer = Buffer<OT>

Source§

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

Source§

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

Source§

type Buffer = Buffer<OT>

Source§

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

Source§

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

Source§

type Buffer = Buffer<OT>

Source§

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

Source§

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

Source§

type Buffer = Buffer<T>

Source§

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

Source§

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

Source§

type Buffer = Buffer<T>

Source§

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

Source§

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

Source§

type Buffer = Buffer<T>

Source§

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

Source§

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

Source§

type Buffer = Buffer<T>

Source§

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

Source§

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

Source§

type Buffer = Buffer<T>

Source§

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

Source§

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

Source§

type Buffer = Buffer<T>

Source§

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

Source§

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

Source§

type Buffer = Buffer<T>

Source§

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

Source§

impl Enqueue<Platform, f32> for RandomNormal

Source§

impl Enqueue<Platform, f32> for RandomUniform

Source§

impl From<Host> for Platform

Source§

fn from(host: Host) -> Self

Converts to this type from the input type.
Source§

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

Source§

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 Platform
where L: Access<T>, R: Access<T>, T: CType,

Source§

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 Platform

Source§

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 Platform

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PlatformInstance for Platform

Source§

fn select(size_hint: usize) -> Self

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

impl Random for Platform

Source§

type Normal = RandomNormal

Source§

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<Platform, OT> for Cast<A, IT, OT>

Source§

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

Source§

impl<L, R, IT, OT> ReadValue<Platform, 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<Platform, 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<Platform, 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<Platform, 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<Platform, T> for Linear<T>

Source§

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

Source§

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

Source§

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

Source§

impl<L, R, T> ReadValue<Platform, 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<Platform, T> for Reduce<A, T>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl ReadValue<Platform, f32> for RandomNormal

Source§

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

Source§

impl ReadValue<Platform, f32> for RandomUniform

Source§

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

Source§

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

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 Platform

Source§

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: Access<T>, T: CType> Transform<A, T> for Platform

Source§

type Broadcast = View<A, T>

Source§

type Slice = Slice<A, T>

Source§

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

Source§

impl Eq for Platform

Source§

impl StructuralPartialEq for Platform

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

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,

Source§

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

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V