pub struct HistogramPlan<T: Element> { /* private fields */ }Expand description
histogram plan.
1-D uniform-bin histogram via atomic-bin accumulation (PyTorch
torch.histc). Bins cover [lo, hi] uniformly.
When to use: forward 1-D histogram. No BW (set-valued).
Dtypes: input {f32, f64}; output always i32 counts.
Shape limits: input flat [numel]; output [num_bins].
hi ≥ lo, num_bins ≥ 1.
Workspace: none. Launcher zeros output before the kernel
runs.
Precision guarantee: non-deterministic — atomic-bin accumulation order varies across launches. Final counts are data-determined.
Implementations§
Source§impl<T: Element> HistogramPlan<T>
impl<T: Element> HistogramPlan<T>
Sourcepub fn select(
_stream: &Stream,
desc: &HistogramDescriptor,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &HistogramDescriptor, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel for desc.
Sourcepub fn can_implement(&self, args: &HistogramArgs<'_, T>) -> Result<()>
pub fn can_implement(&self, args: &HistogramArgs<'_, T>) -> Result<()>
Validate args.
Sourcepub fn workspace_size(&self) -> usize
pub fn workspace_size(&self) -> usize
Workspace size in bytes.
Sourcepub fn precision_guarantee(&self) -> PrecisionGuarantee
pub fn precision_guarantee(&self) -> PrecisionGuarantee
Numerical guarantees for this plan’s kernel.
Auto Trait Implementations§
impl<T> Freeze for HistogramPlan<T>
impl<T> RefUnwindSafe for HistogramPlan<T>where
T: RefUnwindSafe,
impl<T> Send for HistogramPlan<T>where
T: Send,
impl<T> Sync for HistogramPlan<T>where
T: Sync,
impl<T> Unpin for HistogramPlan<T>where
T: Unpin,
impl<T> UnsafeUnpin for HistogramPlan<T>
impl<T> UnwindSafe for HistogramPlan<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