Skip to main content

UnsortedSegmentProdPlan

Struct UnsortedSegmentProdPlan 

Source
pub struct UnsortedSegmentProdPlan<T: Element> { /* private fields */ }
Expand description

unsorted_segment_prod plan. Phase 25.

out[s, d] = Π input[n, d] over n : segment_ids[n] == s (any order). atomicMul-emulated CAS retry loop.

When to use: forward unsorted segment-product. For sorted IDs prefer the deterministic SegmentProdPlan. BW shares the SegmentProdBackwardPlan shape.

Dtypes: {f32, f64} only — atomicCAS slot widths are 32 / 64 bit. Empty segments emit 1.0 (multiplicative identity).

Workspace: none.

Precision guarantee: non-deterministic — atomic ordering varies across launches.

Implementations§

Source§

impl<T: Element> UnsortedSegmentProdPlan<T>

Source

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

Pick a kernel.

Source

pub fn can_implement(&self, args: &UnsortedSegmentProdArgs<'_, T>) -> Result<()>

Validate args.

Source

pub fn workspace_size(&self) -> usize

Workspace size — zero.

Source

pub fn sku(&self) -> KernelSku

Identity of the kernel.

Source

pub fn precision_guarantee(&self) -> PrecisionGuarantee

Numerical guarantees.

Source

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

Launch.

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