pub struct CpuSimd<const WIDTH: usize>;Expand description
Portable CPU SIMD platform
This uses scalar emulation for portability. In a real implementation, this would use std::simd or platform-specific intrinsics (AVX-512, NEON).
Trait Implementations§
Source§impl<const WIDTH: usize> Platform for CpuSimd<WIDTH>
impl<const WIDTH: usize> Platform for CpuSimd<WIDTH>
Source§type Vector<T: GpuValue> = PortableVector<T, WIDTH>
type Vector<T: GpuValue> = PortableVector<T, WIDTH>
The vector type for this platform
Source§fn shuffle<T: GpuValue>(
source: Self::Vector<T>,
indices: Self::Vector<u32>,
) -> Self::Vector<T>
fn shuffle<T: GpuValue>( source: Self::Vector<T>, indices: Self::Vector<u32>, ) -> Self::Vector<T>
Shuffle: each lane reads from source[indices[lane]]
Source§fn shuffle_down<T: GpuValue>(
source: Self::Vector<T>,
delta: usize,
) -> Self::Vector<T>
fn shuffle_down<T: GpuValue>( source: Self::Vector<T>, delta: usize, ) -> Self::Vector<T>
Shuffle down: lane i reads from lane i+delta (with wrapping or clamping)
Source§fn shuffle_xor<T: GpuValue>(
source: Self::Vector<T>,
mask: usize,
) -> Self::Vector<T>
fn shuffle_xor<T: GpuValue>( source: Self::Vector<T>, mask: usize, ) -> Self::Vector<T>
Shuffle XOR: lane i reads from lane i^mask
Source§fn reduce_sum<T: GpuValue + Add<Output = T>>(values: Self::Vector<T>) -> T
fn reduce_sum<T: GpuValue + Add<Output = T>>(values: Self::Vector<T>) -> T
Sum all lanes, result available in all lanes (uniform)
Source§fn ballot(predicates: Self::Vector<bool>) -> Self::Mask
fn ballot(predicates: Self::Vector<bool>) -> Self::Mask
Ballot: collect per-lane bools into a mask
Source§fn mask_popcount(mask: Self::Mask) -> u32
fn mask_popcount(mask: Self::Mask) -> u32
Population count of a mask
impl<const WIDTH: usize> Copy for CpuSimd<WIDTH>
Auto Trait Implementations§
impl<const WIDTH: usize> Freeze for CpuSimd<WIDTH>
impl<const WIDTH: usize> RefUnwindSafe for CpuSimd<WIDTH>
impl<const WIDTH: usize> Send for CpuSimd<WIDTH>
impl<const WIDTH: usize> Sync for CpuSimd<WIDTH>
impl<const WIDTH: usize> Unpin for CpuSimd<WIDTH>
impl<const WIDTH: usize> UnsafeUnpin for CpuSimd<WIDTH>
impl<const WIDTH: usize> UnwindSafe for CpuSimd<WIDTH>
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