[−][src]Trait generic_simd::vector::Vector
The fundamental vector type.
Safety
This trait may only be implemented for types that have the memory layout of an array of
Scalar
with length width()
.
Associated Types
type Scalar: Copy
The type of elements in the vector.
type Token: Token
The token that proves support for this vector on the CPU.
type Width: Width
The number of elements in the vector.
type Underlying: Copy
The underlying type
Required methods
fn zeroed(token: Self::Token) -> Self
Create a new vector with each lane containing zeroes.
fn splat(token: Self::Token, from: Self::Scalar) -> Self
Create a new vector with each lane containing the provided value.
Provided methods
fn width() -> usize
Returns the number of lanes.
fn to_token(self) -> Self::Token
Creates a new instance of Token
from a vector.
fn as_slice(&self) -> &[Self::Scalar]
Returns a slice containing the vector.
fn as_slice_mut(&mut self) -> &mut [Self::Scalar]
Returns a mutable slice containing the vector.
fn to_underlying(self) -> Self::Underlying
Converts this vector to its underlying type.
fn from_underlying(token: Self::Token, underlying: Self::Underlying) -> Self
Converts the underlying type to a vector.
unsafe fn read_ptr(token: Self::Token, from: *const Self::Scalar) -> Self
unsafe fn read_aligned_ptr(
token: Self::Token,
from: *const Self::Scalar
) -> Self
token: Self::Token,
from: *const Self::Scalar
) -> Self
Read from a vector-aligned pointer.
Safety
from
must point to an array of length at leastwidth()
.from
must be aligned for the vector type.
unsafe fn read_unchecked(token: Self::Token, from: &[Self::Scalar]) -> Self
Read from a vector-aligned pointer. Read from a slice without checking the length.
Safety
from
be length at leastwidth()
.
fn read(token: Self::Token, from: &[Self::Scalar]) -> Self
unsafe fn write_ptr(self, to: *mut Self::Scalar)
unsafe fn write_aligned_ptr(self, to: *mut Self::Scalar)
Write to a pointer.
Safety
from
must point to an array of length at least width()
from
must be aligned for the vector type.
unsafe fn write_unchecked(self, to: &mut [Self::Scalar])
fn write(self, to: &mut [Self::Scalar])
Implementors
impl Vector for cf32x1
[src]
type Scalar = Complex<f32>
type Token = Generic
type Width = W1
type Underlying = Complex<f32>
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl Vector for generic_simd::arch::generic::cf64x1
[src]
type Scalar = Complex<f64>
type Token = Generic
type Width = W1
type Underlying = Complex<f64>
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl Vector for f32x1
[src]
type Scalar = f32
type Token = Generic
type Width = W1
type Underlying = f32
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl Vector for f64x1
[src]
type Scalar = f64
type Token = Generic
type Width = W1
type Underlying = f64
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl Vector for cf32x2
[src]
type Scalar = Complex<f32>
type Token = Sse
type Width = W2
type Underlying = __m128
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl Vector for cf32x4
[src]
type Scalar = Complex<f32>
type Token = Avx
type Width = W4
type Underlying = __m256
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl Vector for generic_simd::arch::x86::cf64x1
[src]
type Scalar = Complex<f64>
type Token = Sse
type Width = W1
type Underlying = __m128d
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl Vector for cf64x2
[src]
type Scalar = Complex<f64>
type Token = Avx
type Width = W2
type Underlying = __m256d
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl Vector for f32x4
[src]
type Scalar = f32
type Token = Sse
type Width = W4
type Underlying = __m128
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl Vector for f32x8
[src]
type Scalar = f32
type Token = Avx
type Width = W8
type Underlying = __m256
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl Vector for f64x2
[src]
type Scalar = f64
type Token = Sse
type Width = W2
type Underlying = __m128d
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl Vector for f64x4
[src]
type Scalar = f64
type Token = Avx
type Width = W4
type Underlying = __m256d
fn zeroed(_: Self::Token) -> Self
[src]
fn splat(_: Self::Token, from: Self::Scalar) -> Self
[src]
impl<Underlying, Scalar> Vector for Shim2<Underlying, Scalar> where
Underlying: Vector<Scalar = Scalar>,
Underlying::Width: Double,
Scalar: Copy,
[src]
Underlying: Vector<Scalar = Scalar>,
Underlying::Width: Double,
Scalar: Copy,
type Scalar = Scalar
type Token = <Underlying as Vector>::Token
type Width = <Underlying::Width as Double>::Doubled
type Underlying = [<Underlying as Vector>::Underlying; 2]
fn zeroed(token: Self::Token) -> Self
[src]
fn splat(token: Self::Token, from: Self::Scalar) -> Self
[src]
impl<Underlying, Scalar, Token> Vector for ShimToken<Underlying, Scalar, Token> where
Underlying: Vector<Scalar = Scalar>,
Scalar: Copy,
Token: Token + Into<<Underlying as Vector>::Token>,
[src]
Underlying: Vector<Scalar = Scalar>,
Scalar: Copy,
Token: Token + Into<<Underlying as Vector>::Token>,