51 template <
typename MT,
typename IT>
52 inline void scatterImplementation(MT *mem, IT &&indexes)
const;
58 template <
typename MT,
typename IT>
59 inline void scatterImplementation(MT *mem, IT &&indexes, MaskArgument mask)
const;
62 #define Vc_ASSERT_SCATTER_PARAMETER_TYPES_ \
64 std::is_convertible<EntryType, MT>::value, \
65 "The memory pointer needs to point to a type that the EntryType of this " \
66 "SIMD vector type can be converted to."); \
68 Vc::Traits::has_subscript_operator<IT>::value, \
69 "The indexes argument must be a type that implements the subscript operator."); \
71 !Traits::is_simd_vector<IT>::value || \
72 Traits::simd_vector_size<IT>::value >= Size, \
73 "If you use a SIMD vector for the indexes parameter, the index vector must " \
74 "have at least as many entries as this SIMD vector."); \
76 !std::is_array<T>::value || \
77 (std::rank<T>::value == 1 && \
78 (std::extent<T>::value == 0 || std::extent<T>::value >= Size)), \
79 "If you use a simple array for the indexes parameter, the array must have " \
80 "at least as many entries as this SIMD vector.")
96 template <
typename MT,
98 typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>>
99 Vc_INTRINSIC
void scatter(MT *mem, IT &&indexes)
const
101 Vc_ASSERT_SCATTER_PARAMETER_TYPES_;
102 scatterImplementation(mem, std::forward<IT>(indexes));
106 template <
typename MT,
108 typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>>
109 Vc_INTRINSIC
void scatter(MT *mem, IT &&indexes, MaskArgument mask)
const
111 Vc_ASSERT_SCATTER_PARAMETER_TYPES_;
112 scatterImplementation(mem, std::forward<IT>(indexes), mask);
116 template <
typename S1,
typename IT>
117 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
118 "instead.") void scatter(S1 *array, EntryType S1::*member1,
119 Vc_ALIGNED_PARAMETER(IT) indexes)
const
121 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
122 array, indexes)[member1]
123 .scatterArguments());
126 template <
typename S1,
typename IT>
127 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
128 "instead.") void scatter(S1 *array, EntryType S1::*member1,
129 Vc_ALIGNED_PARAMETER(IT) indexes,
130 MaskArgument mask)
const
132 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
133 array, indexes)[member1]
138 template <
typename S1,
typename S2,
typename IT>
139 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
140 "instead.") void scatter(S1 *array, S2 S1::*member1,
141 EntryType S2::*member2,
142 Vc_ALIGNED_PARAMETER(IT) indexes)
const
144 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
145 array, indexes)[member1][member2]
146 .scatterArguments());
149 template <
typename S1,
typename S2,
typename IT>
150 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
151 "instead.") void scatter(S1 *array, S2 S1::*member1,
152 EntryType S2::*member2,
153 Vc_ALIGNED_PARAMETER(IT) indexes,
154 MaskArgument mask)
const
156 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
157 array, indexes)[member1][member2]
162 template <
typename S1,
typename IT1,
typename IT2>
163 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
164 "instead.") void scatter(S1 *array, EntryType *S1::*ptrMember1,
165 Vc_ALIGNED_PARAMETER(IT1) outerIndexes,
166 Vc_ALIGNED_PARAMETER(IT2)
169 scatter(Common::SubscriptOperation<S1, IT1, std::ratio<1, 1>,
true>(
170 array, outerIndexes)[ptrMember1][innerIndexes]
171 .scatterArguments());
174 template <
typename S1,
typename IT1,
typename IT2>
175 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
176 "instead.") void scatter(S1 *array, EntryType *S1::*ptrMember1,
177 Vc_ALIGNED_PARAMETER(IT1) outerIndexes,
178 Vc_ALIGNED_PARAMETER(IT2) innerIndexes,
179 MaskArgument mask)
const
181 scatter(Common::SubscriptOperation<S1, IT1, std::ratio<1, 1>,
true>(
182 array, outerIndexes)[ptrMember1][innerIndexes]
195 template <
typename MT,
typename IT>
197 Vc_INTRINSIC
void scatter(
const Common::ScatterArguments<MT, IT> &args)
const
199 scatter(args.address, args.indexes);
202 template <
typename MT,
typename IT>
203 Vc_INTRINSIC
void scatter(
const Common::ScatterArguments<MT, IT> &args, MaskArgument mask)
const
205 scatter(args.address, args.indexes, mask);
208 #undef Vc_ASSERT_SCATTER_PARAMETER_TYPES_