xsimd
介绍
官网
https://xsimd.readthedocs.io/en/latest/
https://github.com/xtensor-stack/xsimd
安装
|
|
支持的 指令集
Architecture | Instruction set extensions |
---|---|
x86 | SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, FMA3+SSE, FMA3+AVX, FMA3+AVX2 |
x86 | AVX512BW, AVX512CD, AVX512DQ, AVX512F (gcc7 and higher) |
x86 | AMD FMA4 |
ARM | NEON, NEON64, SVE128/256/512 (fixed vector size) |
简单例子
将 根目录下的 include 文件内容,拷贝到 工程目录下即可
一个例子
|
|
编译命令:
|
|
结果:
|
|
详细介绍
template<class T, class A>
class batch : public types::simd_register<T, A>, public xsimd::types::integral_only_operators<T, A>
batch of integer or floating point values.
Abstract representation of an SIMD register for floating point or integral value.
Template Parameters
- T – the type of the underlying values.
- A – the architecture this batch is tied too.
API
- Data transfer,from memory、to memory
- Arithmetic operators
- Comparison
- Bitwise
- Mathematical
- Reduction operators
- Type conversion
- Type Traits
- Alignment manipulation
- Architecture manipulation