Expand description

VectorEyes is a (almost entirely) safe wrapper library around vectorized operations.

Backends

VectorEyes chooses what backend to execute vector operations with at compile-time.

AVX2

CPUs that support the AVX, AVX2, SSE4.1, AES, SSE4.2, and PCLMULQDQ features will use the AVX2 backend.

In addition, we have embedded specific latency numbers for:

  • skylake
  • skylake-avx512
  • cascadelake
  • znver1
  • znver2
  • znver3

As a result, vectoreyes will be more efficient on these platforms. You can add specific latency numbers for more targets in avx2.py.

Scalar

At the moment, this is the only alternative to the AVX2 backend. It is not particularly optimized.

Cargo Configuration

Native CPU Setup

Compile on the machine that you’ll be running your code on, and add the following to your .cargo/config file:

[build]
rustflags = ["-C", "target-cpu=native", "--cfg=vectoreyes-target-cpu-native"]
rustdocflags = ["-C", "target-cpu=native", "--cfg=vectoreyes-target-cpu-native"]

Specific CPU Selection

If you want to compile for some specific CPU

[build]
rustflags = ["-C", "target-cpu=TARGET", "--cfg=vectoreyes-target-cpu=\"TARGET\""]
rustdocflags = ["-C", "target-cpu=TARGET", "--cfg=vectoreyes-target-cpu=\"TARGET\""]

Maximal Compatibility

If you do not put any of the above in your .cargo/config file, vectoreyes will always use its scalar backend, which does not use vector instructions.

NOTE: many functions are currently missing from this library. Please consult the Intel documentation to see if a non-implemented intrinsic would more directly accomplish your goal, and we can add it!

Modules

Perform manually unrolled operations on arrays.

Structs

[i8; 16] as a vector.
[i8; 32] as a vector.
[i16; 8] as a vector.
[i16; 16] as a vector.
[i32; 4] as a vector.
[i32; 8] as a vector.
[i64; 2] as a vector.
[i64; 4] as a vector.
[u8; 16] as a vector.
[u8; 32] as a vector.
[u16; 8] as a vector.
[u16; 16] as a vector.
[u32; 4] as a vector.
[u32; 8] as a vector.
[u64; 2] as a vector.
[u64; 4] as a vector.

Enums

Constants

The backend that is used to evaluate vector operations.

Traits

Lossily cast a vector by {zero,sign}-extending its values.
A utility trait you probably won’t need to use. See Simd.
A scalar that can live in the lane of a vector.
A vector equivalent to [T; Self::Lanes].
A vector containing 4 lanes.
A vector containing 4 64-bit values.
A vector containing 8-bit values.
A vector containing 8 lanes.
A vector containing 32-bit values.
A vector containing 64-bit values.

Type Definitions

An alternative way of naming SIMD types.