auveh
Auto-vectorization helpers for C++
Loading...
Searching...
No Matches
auveh Namespace Reference

Auto-vectorization helpers. More...

Functions

template<typename Type_ >
constexpr int width ()
 

Detailed Description

Auto-vectorization helpers.

Function Documentation

◆ width()

template<typename Type_ >
int auveh::width ( )
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.

Template Parameters
Type_Type of each vector element. This is typically a numeric type and its size should be a power of 2.
Returns
Vector width in terms of the number of elements of type 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.