29 Numerics library [numerics]

29.10 Data-parallel types [simd]

29.10.8 basic_vec non-member operations [simd.nonmembers]

29.10.8.7 Static permute [simd.permute.static]

template<simd-size-type N = see below, simd-vec-type V, class IdxMap> constexpr resize_t<N, V> permute(const V& v, IdxMap&& idxmap); template<simd-size-type N = see below, simd-mask-type M, class IdxMap> constexpr resize_t<N, M> permute(const M& v, IdxMap&& idxmap);
Let:
  • gen-fn(i) be idxmap(i, V​::​size() if that expression is well-formed, and idxmap(i) otherwise.
  • perm-fn be the following exposition-only function template: template<simd-size-type I> typename V::value_type perm-fn() { constexpr auto src_index = gen-fn(I); if constexpr (src_index == zero_element) { return typename V::value_type(); } else if constexpr (src_index == uninit_element) { return unspecified-value; } else { return v[src_index]; } }
Constraints: At least one of invoke_result_t<IdxMap&, simd-size-type> and invoke_result_t<IdxMap&, simd-size-type, simd-size-type> satisfies integral.
Mandates: gen-fn(i) is a constant expression whose value is zero_element, uninit_element, or in the range [0, V​::​size()), for all i in the range [0, N).
Returns: A data-parallel object where the
Remarks: The default argument for template parameter N is V​::​size().

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant