StreamCast

Trait StreamCast 

Source
pub trait StreamCast<D: Scalar> {
    type CastOutput<D2: Scalar, OutPacket: M>
       where D: Cast<D2>;

    // Required method
    fn cast<D2: Scalar, OutPacket: M>(self) -> Self::CastOutput<D2, OutPacket>
       where D: Cast<D2>;
}
Expand description

Trait for stream tensors that can be cast to a different scalar type.

FIXME: This trait exists purely to disambiguate tensor cast() from scalar Cast::cast() for rust-analyzer.

Required Associated Types§

Source

type CastOutput<D2: Scalar, OutPacket: M> where D: Cast<D2>

The output tensor type after casting to scalar type D2.

Required Methods§

Source

fn cast<D2: Scalar, OutPacket: M>(self) -> Self::CastOutput<D2, OutPacket>
where D: Cast<D2>,

Casts this tensor’s scalar type from D to D2.

The cast engine operates on a single 32-byte flit. The input packet must already be exactly 32 bytes (ensured by the Collect Engine). After casting, the output packet is padded back to 32 bytes. Time passes through unchanged.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'l, const T: Tu, D: VeScalar, Chip: M, Cluster: M, Slice: M, Time: M, Packet: M> StreamCast<D> for AccumulationTensor<'l, T, D, Chip, Cluster, Slice, Time, Packet>

Source§

type CastOutput<D2: Scalar, OutPacket: M> = StreamTensor<'l, T, PositionCast, D2, Chip, Cluster, Slice, Time, OutPacket> where D: Cast<D2>

Source§

impl<'l, const T: Tu, D: VeScalar, Chip: M, Cluster: M, Slice: M, Time: M, Packet: M> StreamCast<D> for CollectTensor<'l, T, D, Chip, Cluster, Slice, Time, Packet>

Source§

type CastOutput<D2: Scalar, OutPacket: M> = StreamTensor<'l, T, PositionCast, D2, Chip, Cluster, Slice, Time, OutPacket> where D: Cast<D2>

Source§

impl<'l, const T: Tu, D: VeScalar, Chip: M, Cluster: M, Slice: M, Time: M, Packet: M> StreamCast<D> for VectorFinalTensor<'l, T, D, Chip, Cluster, Slice, Time, Packet>

Source§

type CastOutput<D2: Scalar, OutPacket: M> = StreamTensor<'l, T, PositionCast, D2, Chip, Cluster, Slice, Time, OutPacket> where D: Cast<D2>