|
auveh
Auto-vectorization helpers for C++
|
Auto-vectorization helpers. More...
Functions | |
| template<typename Type_ > | |
| constexpr int | width () |
Auto-vectorization helpers.
|
constexpr |
Get the vector width in terms of the number of elements of the specified Type_. In C++26, this will use the native size of std::simd::basic_vec, otherwise it will try to infer the vector width from various compiler macros. This is occasionally useful to encourage autovectorization when processing a fixed number of elements, e.g., in blocking schemes.
| Type_ | Type of each vector element. This is typically a numeric type and its size should be a power of 2. |
Type_. This is guaranteed to be positive and is set to 1 if no vector capability is available or if Type_ is larger than the SIMD vector width.