Skip to main content

SimdVector

Trait SimdVector 

Source
pub trait SimdVector<T: GpuValue>: Copy {
    const WIDTH: usize;

    // Required methods
    fn splat(value: T) -> Self;
    fn extract(self, lane: usize) -> T;
    fn insert(self, lane: usize, value: T) -> Self;
}
Expand description

Platform-specific SIMD vector type

Required Associated Constants§

Source

const WIDTH: usize

Number of lanes in this vector

Required Methods§

Source

fn splat(value: T) -> Self

Create a vector with all lanes set to the same value

Source

fn extract(self, lane: usize) -> T

Extract value from a specific lane

Source

fn insert(self, lane: usize, value: T) -> Self

Insert value into a specific lane

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: GpuValue, const WIDTH: usize> SimdVector<T> for PortableVector<T, WIDTH>

Source§

const WIDTH: usize = WIDTH