50 template <
typename MT,
typename IT>
51 inline void scatterImplementation(MT *mem, IT &&indexes)
const;
57 template <
typename MT,
typename IT>
58 inline void scatterImplementation(MT *mem, IT &&indexes, MaskArgument mask)
const;
61 #define Vc_ASSERT_SCATTER_PARAMETER_TYPES_ \
63 std::is_convertible<EntryType, MT>::value, \
64 "The memory pointer needs to point to a type that the EntryType of this " \
65 "SIMD vector type can be converted to."); \
67 Vc::Traits::has_subscript_operator<IT>::value, \
68 "The indexes argument must be a type that implements the subscript operator."); \
70 !Traits::is_simd_vector<IT>::value || \
71 Traits::simd_vector_size<IT>::value >= Size, \
72 "If you use a SIMD vector for the indexes parameter, the index vector must " \
73 "have at least as many entries as this SIMD vector."); \
75 !std::is_array<T>::value || \
76 (std::rank<T>::value == 1 && \
77 (std::extent<T>::value == 0 || std::extent<T>::value >= Size)), \
78 "If you use a simple array for the indexes parameter, the array must have " \
79 "at least as many entries as this SIMD vector.")
95 template <
typename MT,
97 typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>>
98 Vc_INTRINSIC
void scatter(MT *mem, IT &&indexes)
const
100 Vc_ASSERT_SCATTER_PARAMETER_TYPES_;
101 scatterImplementation(mem, std::forward<IT>(indexes));
105 template <
typename MT,
107 typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>>
108 Vc_INTRINSIC
void scatter(MT *mem, IT &&indexes, MaskArgument mask)
const
110 Vc_ASSERT_SCATTER_PARAMETER_TYPES_;
111 scatterImplementation(mem, std::forward<IT>(indexes), mask);
130 template <
typename S1,
typename IT>
131 Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
132 "instead.") inline
void scatter(S1 *array, EntryType S1::*member1,
135 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
136 array, indexes)[member1]
137 .scatterArguments());
153 template <
typename S1,
typename IT>
154 Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
155 "instead.") inline
void scatter(S1 *array, EntryType S1::*member1,
156 IT indexes, MaskArgument mask)
const
158 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
159 array, indexes)[member1]
178 template <
typename S1,
typename S2,
typename IT>
179 Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
180 "instead.") inline
void scatter(S1 *array, S2 S1::*member1,
181 EntryType S2::*member2,
184 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
185 array, indexes)[member1][member2]
186 .scatterArguments());
204 template <
typename S1,
typename S2,
typename IT>
205 Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
206 "instead.") inline
void scatter(S1 *array, S2 S1::*member1,
207 EntryType S2::*member2, IT indexes,
208 MaskArgument mask)
const
210 scatter(Common::SubscriptOperation<S1, IT, std::ratio<1, 1>,
true>(
211 array, indexes)[member1][member2]
227 template <
typename S1,
typename IT1,
typename IT2>
228 Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
229 "instead.") inline
void scatter(S1 *array, EntryType *S1::*ptrMember1,
231 IT2 innerIndexes)
const
233 scatter(Common::SubscriptOperation<S1, IT1, std::ratio<1, 1>,
true>(
234 array, outerIndexes)[ptrMember1][innerIndexes]
235 .scatterArguments());
250 template <
typename S1,
typename IT1,
typename IT2>
251 Vc_DEPRECATED(
"use the subscript operator to Vc::array or Vc::vector "
252 "instead.") inline
void scatter(S1 *array, EntryType *S1::*ptrMember1,
253 IT1 outerIndexes, IT2 innerIndexes,
254 MaskArgument mask)
const
256 scatter(Common::SubscriptOperation<S1, IT1, std::ratio<1, 1>,
true>(
257 array, outerIndexes)[ptrMember1][innerIndexes]
269 template <
typename MT,
typename IT>
271 Vc_INTRINSIC
void scatter(
const Common::ScatterArguments<MT, IT> &args)
const
273 scatter(args.address, args.indexes);
276 template <
typename MT,
typename IT>
277 Vc_INTRINSIC
void scatter(
const Common::ScatterArguments<MT, IT> &args, MaskArgument mask)
const
279 scatter(args.address, args.indexes, mask);
282 #undef Vc_ASSERT_SCATTER_PARAMETER_TYPES_