Skip to main content

CastSubBytePlan

Struct CastSubBytePlan 

Source
pub struct CastSubBytePlan<TIn: DeviceRepr + Copy + 'static, TOut: DeviceRepr + Copy + 'static> { /* private fields */ }
Expand description

Sub-byte cast plan.

TIn is the input element type, TOut is the output element type. Both are bounded by baracuda_types::DeviceRepr only (not baracuda_kernels_types::Element) so the dtype set can include S4, U4, Fp8E4M3, Fp8E5M2, and Bool alongside the classic fp / int element types.

Coverage: see the crate-level module docs for the full supported (TIn, TOut) pair list. A select-time check rejects any pair outside the explicit table with Error::Unsupported.

Workspace: none.

Implementations§

Source§

impl<TIn: DeviceRepr + Copy + 'static, TOut: DeviceRepr + Copy + 'static> CastSubBytePlan<TIn, TOut>

Source

pub fn select( _stream: &Stream, desc: &CastSubByteDescriptor, _pref: PlanPreference, ) -> Result<Self>

Pick a kernel for desc.

Source

pub fn can_implement(&self, args: &CastSubByteArgs<'_, TIn, TOut>) -> Result<()>

Validate args. Checks numel agreement and buffer sizing (the S4 / U4 packed-buffer accounting collapses to numel / 2 bytes, which is numel / 2 packed-slot elements at the buffer layer).

Source

pub fn workspace_size(&self) -> usize

Workspace size in bytes. Always 0.

Source

pub fn sku(&self) -> KernelSku

Identity of the kernel this plan picked.

Source

pub fn precision_guarantee(&self) -> PrecisionGuarantee

Numerical guarantees for this plan’s kernel.

Source

pub fn run( &self, stream: &Stream, _workspace: Workspace<'_>, args: CastSubByteArgs<'_, TIn, TOut>, ) -> Result<()>

Launch.

Auto Trait Implementations§

§

impl<TIn, TOut> Freeze for CastSubBytePlan<TIn, TOut>

§

impl<TIn, TOut> RefUnwindSafe for CastSubBytePlan<TIn, TOut>
where TIn: RefUnwindSafe, TOut: RefUnwindSafe,

§

impl<TIn, TOut> Send for CastSubBytePlan<TIn, TOut>
where TIn: Send, TOut: Send,

§

impl<TIn, TOut> Sync for CastSubBytePlan<TIn, TOut>
where TIn: Sync, TOut: Sync,

§

impl<TIn, TOut> Unpin for CastSubBytePlan<TIn, TOut>
where TIn: Unpin, TOut: Unpin,

§

impl<TIn, TOut> UnsafeUnpin for CastSubBytePlan<TIn, TOut>

§

impl<TIn, TOut> UnwindSafe for CastSubBytePlan<TIn, TOut>
where TIn: UnwindSafe, TOut: UnwindSafe,

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