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__ \
63 static_assert(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."); \
69 static_assert(!Traits::is_simd_vector<IT>::value || Traits::simd_vector_size<IT>::value >= Size, \
70 "If you use a SIMD vector for the indexes parameter, the index vector must " \
71 "have at least as many entries as this SIMD vector."); \
72 static_assert(!std::is_array<T>::value || \
73 (std::rank<T>::value == 1 && \
74 (std::extent<T>::value == 0 || std::extent<T>::value >= Size)), \
75 "If you use a simple array for the indexes parameter, the array must have " \
76 "at least as many entries as this SIMD vector.")
92 template <
typename MT,
94 typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>>
95 Vc_INTRINSIC
void scatter(MT *mem, IT &&indexes)
const
97 Vc_ASSERT_SCATTER_PARAMETER_TYPES__;
98 scatterImplementation(mem, std::forward<IT>(indexes));
102 template <
typename MT,
104 typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>>
105 Vc_INTRINSIC
void scatter(MT *mem, IT &&indexes, MaskArgument mask)
const
107 Vc_ASSERT_SCATTER_PARAMETER_TYPES__;
108 scatterImplementation(mem, std::forward<IT>(indexes), mask);
118 template <
typename MT,
typename IT>
120 Vc_INTRINSIC
void scatter(
const Common::ScatterArguments<MT, IT> &args)
const
122 scatter(args.address, args.indexes);
125 template <
typename MT,
typename IT>
126 Vc_INTRINSIC
void scatter(
const Common::ScatterArguments<MT, IT> &args, MaskArgument mask)
const
128 scatter(args.address, args.indexes, mask);
131 #undef Vc_ASSERT_SCATTER_PARAMETER_TYPES__