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);
131 template <
typename S1,
typename IT>
132 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
133 "instead.") void scatter(S1 *array, EntryType S1::*member1,
134 Vc_ALIGNED_PARAMETER(IT) indexes)
const
136 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
137 array, indexes)[member1]
138 .scatterArguments());
154 template <
typename S1,
typename IT>
155 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
156 "instead.") void scatter(S1 *array, EntryType S1::*member1,
157 Vc_ALIGNED_PARAMETER(IT) indexes,
158 MaskArgument mask)
const
160 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
161 array, indexes)[member1]
180 template <
typename S1,
typename S2,
typename IT>
181 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
182 "instead.") void scatter(S1 *array, S2 S1::*member1,
183 EntryType S2::*member2,
184 Vc_ALIGNED_PARAMETER(IT) indexes)
const
186 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
187 array, indexes)[member1][member2]
188 .scatterArguments());
206 template <
typename S1,
typename S2,
typename IT>
207 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
208 "instead.") void scatter(S1 *array, S2 S1::*member1,
209 EntryType S2::*member2,
210 Vc_ALIGNED_PARAMETER(IT) indexes,
211 MaskArgument mask)
const
213 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
214 array, indexes)[member1][member2]
230 template <
typename S1,
typename IT1,
typename IT2>
231 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
232 "instead.") void scatter(S1 *array, EntryType *S1::*ptrMember1,
233 Vc_ALIGNED_PARAMETER(IT1) outerIndexes,
234 Vc_ALIGNED_PARAMETER(IT2)
237 scatter(Common::SubscriptOperation<S1, IT1, std::ratio<1, 1>,
true>(
238 array, outerIndexes)[ptrMember1][innerIndexes]
239 .scatterArguments());
254 template <
typename S1,
typename IT1,
typename IT2>
255 inline Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
256 "instead.") void scatter(S1 *array, EntryType *S1::*ptrMember1,
257 Vc_ALIGNED_PARAMETER(IT1) outerIndexes,
258 Vc_ALIGNED_PARAMETER(IT2) innerIndexes,
259 MaskArgument mask)
const
261 scatter(Common::SubscriptOperation<S1, IT1, std::ratio<1, 1>,
true>(
262 array, outerIndexes)[ptrMember1][innerIndexes]
274 template <
typename MT,
typename IT>
276 Vc_INTRINSIC
void scatter(
const Common::ScatterArguments<MT, IT> &args)
const
278 scatter(args.address, args.indexes);
281 template <
typename MT,
typename IT>
282 Vc_INTRINSIC
void scatter(
const Common::ScatterArguments<MT, IT> &args, MaskArgument mask)
const
284 scatter(args.address, args.indexes, mask);
287 #undef Vc_ASSERT_SCATTER_PARAMETER_TYPES_