29 Numerics library [numerics]

29.10 Data-parallel types [simd]

29.10.7 basic_simd non-member operations [simd.nonmembers]

29.10.7.8 basic_simd and basic_simd_mask creation [simd.creation]

template<class T, class Abi> constexpr auto chunk(const basic_simd<typename T::value_type, Abi>& x) noexcept; template<class T, class Abi> constexpr auto chunk(const basic_simd_mask<mask-element-size<T>, Abi>& x) noexcept;
Constraints:
  • For the first overload T is an enabled specialization of basic_simd.
    If basic_simd<typename T​::​​value_type, Abi>​::​size() % T​::​size() is not 0 then resize_t<basic_simd<typename T​::​​value_type, Abi>​::​size() % T​::​size(), T> is valid and denotes a type.
  • For the second overload T is an enabled specialization of basic_simd_mask.
    If basic_simd_mask<mask-element-size<T>, Abi>​::​size() % T​::​size() is not 0 then resize_t<​basic_simd_mask<mask-element-size<T>, Abi>​::​size() % T​::​size(), T> is valid and denotes a type.
Let N be x.size() / T​::​size().
Returns:
  • If x.size() % T​::​size() == 0 is true, an array<T, N> with the basic_simd or basic_simd_mask element of the array element initialized to the value of the element in x with index i + j * T​::​size().
  • Otherwise, a tuple of N objects of type T and one object of type resize_t<x.size() % T​::​size(), T>.
    The basic_simd or basic_simd_mask element of the tuple element of type T is initialized to the value of the element in x with index i + j * T​::​size().
    The basic_simd or basic_simd_mask element of the tuple element is initialized to the value of the element in x with index i + N * T​::​size().
template<size_t N, class T, class Abi> constexpr auto chunk(const basic_simd<T, Abi>& x) noexcept;
Effects: Equivalent to: return chunk<resize_t<N, basic_simd<T, Abi>>>(x);
template<size_t N, size_t Bytes, class Abi> constexpr auto chunk(const basic_simd_mask<Bytes, Abi>& x) noexcept;
Effects: Equivalent to: return chunk<resize_t<N, basic_simd_mask<Bytes, Abi>>>(x);
template<class T, class... Abis> constexpr simd<T, (basic_simd<T, Abis>::size() + ...)> cat(const basic_simd<T, Abis>&... xs) noexcept; template<size_t Bytes, class... Abis> constexpr basic_simd_mask<Bytes, deduce-abi-t<integer-from<Bytes>, (basic_simd_mask<Bytes, Abis>::size() + ...)>> cat(const basic_simd_mask<Bytes, Abis>&... xs) noexcept;
Constraints:
  • For the first overload simd<T, (basic_simd<T, Abis>​::​size() + ...)> is enabled.
  • For the second overload basic_simd_mask<Bytes, deduce-abi-t<integer-from<Bytes>, (basic_simd_mask<Bytes, Abis>​::​size() + ...)>> is enabled.
Returns: A data-parallel object initialized with the concatenated values in the xs pack of data-parallel objects: The basic_simd/basic_simd_mask element of the parameter in the xs pack is copied to the return value's element with index i + the sum of the width of the first j parameters in the xs pack.