std::simd::basic_vec, std::simd::simd
Defined in header <simd> | ||
|---|---|---|
template< class T, class Abi = /*native-abi*/<T> > class basic_vec; | (1) | (since C++26) |
template< class T, /*simd-size-type*/ N = /*simd-size-v*/<T, /*native-abi*/<T>> > using simd = basic_vec<T, /*deduce-abi-t*/<T, N>>; | (2) | (since C++26) |
std::simd::basic_vec specialization is a data-parallel type. The default ABI tag is determined by the implementation at compile-time.std::simd::vec is an alias template that allows users to specify the width to a certain size. The default width is determined by the implementation at compile-time.Every specialization of basic_vec is a complete type. The specialization is
-
enabled, if
Tis a vectorizable type, and there exists valueMin the range[1,64]such thatAbiisdeduce-abi-t<T,M>, - otherwise disabled, if
Tis not a vectorizable type, - otherwise, it is implementation-defined if such specialization is enabled.
If basic_vec<T,Abi> is disabled, the specialization has all deleted default constructor, destructor, copy constructor, and copy assignment. In addition, only the member types below are present.
If basic_vec<T,Abi> is enabled, basic_vec<T,Abi> is TriviallyCopyable.
Template parameters
| T | - | element type; a vectorizable type |
| Abi | - | tag type used to determine the width and storage |
| N | - | the width of the data-parallel type; the number of elements |
Member types
| Type | Definition |
|---|---|
value_type |
T |
mask_type | simd::basic_mask<sizeof(T),Abi> |
abi_type |
Abi |
Member constant
| Name | Description |
|---|---|
|
[static] | the width of basic_vec (public static member constant) |
Member functions
Template:cpp/numeric/simd/basic vec/dsc constructorTemplate:cpp/numeric/simd/basic vec/dsc operator atTemplate:cpp/numeric/simd/basic vec/dsc operator mem arithTemplate:cpp/numeric/simd/basic vec/dsc operator mem arith2Non-member functions
Template:cpp/numeric/simd/basic vec/dsc operator arithTemplate:cpp/numeric/simd/basic vec/dsc operator compoundTemplate:cpp/numeric/simd/basic vec/dsc operator cmpDeduction guide
template< class R, class... Ts > basic_vec( R&& r, Ts... ) -> /* see below */; | (since C++26) |
The deduction guide is present only if:
-
Rmodelscontiguous_rangeandsized_range, and -
ranges::size(r)is a constant expression.
The deduced type is equivalent to simd::vec<ranges::range_value_t<R>,ranges::size(r)>.
Notes
Implementations are recommended to support explicit conversions between enabled specializations of basic_vec and appropriate implementation-defined types. These appropriate types are non-standard vector types which are available in the implementation.
Example
See also
|
(C++26) | data-parallel type with the element type bool (class template) |
|
(C++26) | convenience alias template for basic_mask that can specify its width(alias template) |
| numeric arrays, array masks and array slices (class template) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/numeric/simd/basic_vec