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>
impl<T: Element> UnsortedSegmentProdPlan<T>
Sourcepub fn select(
_stream: &Stream,
desc: &UnsortedSegmentProdDescriptor,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &UnsortedSegmentProdDescriptor, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel.
Sourcepub fn can_implement(&self, args: &UnsortedSegmentProdArgs<'_, T>) -> Result<()>
pub fn can_implement(&self, args: &UnsortedSegmentProdArgs<'_, T>) -> Result<()>
Validate args.
Sourcepub fn workspace_size(&self) -> usize
pub fn workspace_size(&self) -> usize
Workspace size — zero.
Sourcepub fn precision_guarantee(&self) -> PrecisionGuarantee
pub fn precision_guarantee(&self) -> PrecisionGuarantee
Numerical guarantees.
Auto Trait Implementations§
impl<T> Freeze for UnsortedSegmentProdPlan<T>
impl<T> RefUnwindSafe for UnsortedSegmentProdPlan<T>where
T: RefUnwindSafe,
impl<T> Send for UnsortedSegmentProdPlan<T>where
T: Send,
impl<T> Sync for UnsortedSegmentProdPlan<T>where
T: Sync,
impl<T> Unpin for UnsortedSegmentProdPlan<T>where
T: Unpin,
impl<T> UnsafeUnpin for UnsortedSegmentProdPlan<T>
impl<T> UnwindSafe for UnsortedSegmentProdPlan<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more