29 Numerics library [numerics]

29.10 Data-parallel types [simd]

29.10.8 basic_vec non-member operations [simd.nonmembers]

29.10.8.11 simd memory permute [simd.permute.memory]

template<class V = see below, ranges::contiguous_range R, simd-integral I, class... Flags> requires ranges::sized_range<R> constexpr V unchecked_gather_from(R&& in, const I& indices, flags<Flags...> f = {}); template<class V = see below, ranges::contiguous_range R, simd-integral I, class... Flags> requires ranges::sized_range<R> constexpr V unchecked_gather_from(R&& in, const typename I::mask_type& mask, const I& indices, flags<Flags...> f = {});
Let mask be typename I​::​mask_type(true) for the overload with no mask parameter.
Preconditions: All values in select(mask, indices, typename I​::​value_type()) are in the range [0, ranges​::​size(in)).
Effects: Equivalent to: return partial_gather_from<V>(in, mask, indices, f);
Remarks: The default argument for template parameter V is vec<ranges​::​range_value_t<R>, I​::​​size()>.
template<class V = see below, ranges::contiguous_range R, simd-integral I, class... Flags> requires ranges::sized_range<R> constexpr V partial_gather_from(R&& in, const I& indices, flags<Flags...> f = {}); template<class V = see below, ranges::contiguous_range R, simd-integral I, class... Flags> requires ranges::sized_range<R> constexpr V partial_gather_from(R&& in, const typename I::mask_type& mask, const I& indices, flags<Flags...> f = {});
Let:
  • mask be typename I​::​mask_type(true) for the overload with no mask parameter;
  • T be typename V​::​value_type.
Mandates:
  • ranges​::​range_value_t<R> is a vectorizable type,
  • same_as<remove_cvref_t<V>, V> is true,
  • V is an enabled specialization of basic_vec,
  • V​::​size() == I​::​size() is true, and
  • if the template parameter pack Flags does not contain convert-flag, then the conversion from ranges​::​range_value_t<R> to T is value-preserving.
Preconditions:
  • If the template parameter pack Flags contains aligned-flag, ranges​::​data(in) points to storage aligned by alignment_v<V, ranges​::​range_value_t<R>>.
  • If the template parameter pack Flags contains overaligned-flag<N>, ranges​::​data(in) points to storage aligned by N.
Returns: A basic_vec object where the element is initialized to the result of mask[i] && indices[i] < ranges::size(in) ? static_cast<T>(ranges::data(in)[indices[i]]) : T() for all i in the range [0, I​::​size()).
Remarks: The default argument for template parameter V is vec<ranges​::​range_value_t<R>, I​::​​size()>.
template<simd-vec-type V, ranges::contiguous_range R, simd-integral I, class... Flags> requires ranges::sized_range<R> constexpr void unchecked_scatter_to(const V& v, R&& out, const I& indices, flags<Flags...> f = {}); template<simd-vec-type V, ranges::contiguous_range R, simd-integral I, class... Flags> requires ranges::sized_range<R> constexpr void unchecked_scatter_to(const V& v, R&& out, const typename I::mask_type& mask, const I& indices, flags<Flags...> f = {});
Let mask be typename I​::​mask_type(true) for the overload with no mask parameter.
Preconditions: All values in select(mask, indices, typename I​::​value_type()) are in the range [0, ranges​::​size(out)).
Effects: Equivalent to: partial_scatter_to(v, out, mask, indices, f);
template<simd-vec-type V, ranges::contiguous_range R, simd-integral I, class... Flags> requires ranges::sized_range<R> constexpr void partial_scatter_to(const V& v, R&& out, const I& indices, flags<Flags...> f = {}); template<simd-vec-type V, ranges::contiguous_range R, simd-integral I, class... Flags> requires ranges::sized_range<R> constexpr void partial_scatter_to(const V& v, R&& out, const typename I::mask_type& mask, const I& indices, flags<Flags...> f = {});
Let mask be typename I​::​mask_type(true) for the overload with no mask parameter.
Constraints: V​::​size() == I​::​size() is true.
Mandates:
  • ranges​::​range_value_t<R> is a vectorizable type, and
  • if the template parameter pack Flags does not contain convert-flag, then the conversion from typename V​::​value_type to ranges​::​range_value_t<R> is value-preserving.
Preconditions:
  • For all selected indices i the values indices[i] are unique.
  • If the template parameter pack Flags contains aligned-flag, ranges​::​data(out) points to storage aligned by alignment_v<V, ranges​::​range_value_t<R>>.
  • If the template parameter pack Flags contains overaligned-flag<N>, ranges​::​data(out) points to storage aligned by N.
Effects: For all i in the range [0, I​::​size()), if mask[i] && (indices[i] < ranges​::​size(out)) is true, evaluates ranges​::​data(out)[indices[i]] = v[i].