10 KiB
[simd.permute.memory]
29 Numerics library [numerics]
29.10 Data-parallel types [simd]
29.10.8 basic_vec non-member operations [simd.nonmembers]
29.10.8.10 simd memory permute [simd.permute.memory]
template<class V = see below, ranges::[contiguous_range](range.refinements#concept:contiguous_range "25.4.6 Other range refinements [range.refinements]") R, [simd-integral](simd.expos#concept:simd-integral "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") I, class... Flags> requires ranges::[sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<R> constexpr V unchecked_gather_from(R&& in, const I& indices, flags<Flags...> f = {}); template<class V = see below, ranges::[contiguous_range](range.refinements#concept:contiguous_range "25.4.6 Other range refinements [range.refinements]") R, [simd-integral](simd.expos#concept:simd-integral "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") I, class... Flags> requires ranges::[sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<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(in, mask, indices, f);
Remarks: The default argument for template parameter V isvec<ranges::range_value_t, I::size()>.
template<class V = see below, ranges::[contiguous_range](range.refinements#concept:contiguous_range "25.4.6 Other range refinements [range.refinements]") R, [simd-integral](simd.expos#concept:simd-integral "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") I, class... Flags> requires ranges::[sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<R> constexpr V partial_gather_from(R&& in, const I& indices, flags<Flags...> f = {}); template<class V = see below, ranges::[contiguous_range](range.refinements#concept:contiguous_range "25.4.6 Other range refinements [range.refinements]") R, [simd-integral](simd.expos#concept:simd-integral "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") I, class... Flags> requires ranges::[sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<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 is a vectorizable type,
same_as<remove_cvref_t, 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 containconvert-flag, then the conversion fromranges::range_value_t to T is value-preserving.
Preconditions:
-
If the template parameter pack Flags containsaligned-flag, ranges::data(in) points to storage aligned byalignment_v<V, ranges::range_value_t>.
-
If the template parameter pack Flags containsoveraligned-flag, ranges::data(in) points to storage aligned by N.
Returns: A basic_vec object where the ith element is initialized to the result ofmask[i] && indices[i] < ranges::size(in) ? static_cast(ranges::data(in)[indices[i]]) : T() for all i in the range [0, I::size()).
Remarks: The default argument for template parameter V isvec<ranges::range_value_t, I::size()>.
template<[simd-vec-type](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V, ranges::[contiguous_range](range.refinements#concept:contiguous_range "25.4.6 Other range refinements [range.refinements]") R, [simd-integral](simd.expos#concept:simd-integral "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") I, class... Flags> requires ranges::[sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<R> constexpr void unchecked_scatter_to(const V& v, R&& out, const I& indices, flags<Flags...> f = {}); template<[simd-vec-type](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V, ranges::[contiguous_range](range.refinements#concept:contiguous_range "25.4.6 Other range refinements [range.refinements]") R, [simd-integral](simd.expos#concept:simd-integral "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") I, class... Flags> requires ranges::[sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<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](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V, ranges::[contiguous_range](range.refinements#concept:contiguous_range "25.4.6 Other range refinements [range.refinements]") R, [simd-integral](simd.expos#concept:simd-integral "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") I, class... Flags> requires ranges::[sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<R> constexpr void partial_scatter_to(const V& v, R&& out, const I& indices, flags<Flags...> f = {}); template<[simd-vec-type](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V, ranges::[contiguous_range](range.refinements#concept:contiguous_range "25.4.6 Other range refinements [range.refinements]") R, [simd-integral](simd.expos#concept:simd-integral "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") I, class... Flags> requires ranges::[sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<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 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 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 byalignment_v<V, ranges::range_value_t>.
-
If the template parameter pack Flags containsoveraligned-flag,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, evaluatesranges::data(out)[indices[i]] = v[i].