| Technical Specification | ||||
| Filesystem library(filesystem TS) | ||||
| Library fundamentals(library fundamentals TS) | ||||
| Library fundamentals 2(library fundamentals TS v2) | ||||
| Library fundamentals 3(library fundamentals TS v3) | ||||
| Extensions for parallelism(parallelism TS) | ||||
| Extensions for parallelism 2(parallelism TS v2) | ||||
| Extensions for concurrency(concurrency TS) | ||||
| Extensions for concurrency 2(concurrency TS v2) | ||||
| Concepts(concepts TS) | ||||
| Ranges(ranges TS) | ||||
| Reflection(reflection TS) | ||||
| Mathematical special functions(special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
| Parallel exceptions | ||||
| Additional execution policies | ||||
| Algorithms | ||||
| Task blocks | ||||
| Data-parallel vectors | ||||
Defined in header <experimental/simd> | ||
template<class T,class V> struct rebind_simd; | (1) | (parallelism TS v2) |
template<int N,class V> struct resize_simd; | (2) | (parallelism TS v2) |
Creates asimd orsimd_mask type with a different element type or size. The new type likely uses an ABI tag type different fromV::abi_type.
T and keeps the size unchanged.N and keeps the element type unchanged.Contents |
| T | - | the new element type; an arithmetic type other thanbool |
| N | - | the new number of elements |
| V | - | asimd orsimd_mask type |
| Name | Definition |
type | simd orsimd_mask type with a different element type(1) or size(2) |
template<class T,class V> using rebind_simd_t=typename rebind_simd<T, V>::type; | (parallelism TS v2) | |
template<int N,class V> using resize_simd_t=typename resize_simd<N, V>::type; | (parallelism TS v2) | |
#include <experimental/simd>#include <iostream> namespace stdx= std::experimental;using floatv= stdx::native_simd<float>; // use double precision internallyfloatv dp(floatv x){using doublev= stdx::rebind_simd_t<double, floatv>;return stdx::static_simd_cast<floatv>(stdx::simd_cast<doublev>(x)-1.234);} template<class T>stdx::resize_simd_t<T::size()/2, T> partial_reduction(T x){auto[lo, hi]= stdx::split<stdx::resize_simd_t<T::size()/2, T>>(x);return lo+ hi;} int main(){ floatv x([](auto i){return1.234f+std::numeric_limits<float>::epsilon()* i;}); x= dp(x);constauto y= partial_reduction(x);for(unsigned i=0; i< y.size();++i)std::cout<< y[i]<<' ';std::cout<<'\n';}
Possible output:
1.73569e-07 4.11987e-07
(parallelism TS v2) | obtains an ABI type for given element type and number of elements (class template)[edit] |