28 #ifndef Vc_CURRENT_CLASS_NAME
29 #error "incorrect use of common/gatherinterface.h: Vc_CURRENT_CLASS_NAME must be defined to the current class name for declaring constructors."
55 template <
class MT,
class IT,
int Scale = 1>
56 inline void gatherImplementation(
const Common::GatherArguments<MT, IT, Scale> &);
62 template <
class MT,
class IT,
int Scale = 1>
63 inline void gatherImplementation(
const Common::GatherArguments<MT, IT, Scale> &,
67 #define Vc_ASSERT_GATHER_PARAMETER_TYPES_ \
69 std::is_convertible<MT, EntryType>::value, \
70 "The memory pointer needs to point to a type that can be converted to the " \
71 "EntryType of this SIMD vector type."); \
73 Vc::Traits::has_subscript_operator<IT>::value, \
74 "The indexes argument must be a type that implements the subscript operator."); \
76 !Traits::is_simd_vector<IT>::value || \
77 Traits::simd_vector_size<IT>::value >= Size, \
78 "If you use a SIMD vector for the indexes parameter, the index vector must " \
79 "have at least as many entries as this SIMD vector."); \
81 !std::is_array<T>::value || \
82 (std::rank<T>::value == 1 && \
83 (std::extent<T>::value == 0 || std::extent<T>::value >= Size)), \
84 "If you use a simple array for the indexes parameter, the array must have " \
85 "at least as many entries as this SIMD vector.")
140 template <
typename MT,
typename IT,
141 typename = enable_if<Traits::has_subscript_operator<IT>::value>>
142 Vc_INTRINSIC Vc_CURRENT_CLASS_NAME(
const MT *mem,
const IT &indexes)
144 Vc_ASSERT_GATHER_PARAMETER_TYPES_;
145 gatherImplementation(
146 Common::make_gather<1>(mem, Common::convertIndexVector(indexes)));
149 template <
class MT,
class IT,
int Scale>
150 Vc_INTRINSIC Vc_CURRENT_CLASS_NAME(
const Common::GatherArguments<MT, IT, Scale> &args)
152 Vc_ASSERT_GATHER_PARAMETER_TYPES_;
153 gatherImplementation(args);
157 template <
typename MT,
typename IT,
158 typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>>
159 Vc_INTRINSIC Vc_CURRENT_CLASS_NAME(
const MT *mem,
const IT &indexes,
162 Vc_ASSERT_GATHER_PARAMETER_TYPES_;
163 gatherImplementation(
164 Common::make_gather<1>(mem, Common::convertIndexVector(indexes)), mask);
167 template <
class MT,
class IT,
int Scale>
168 Vc_INTRINSIC Vc_CURRENT_CLASS_NAME(
const Common::GatherArguments<MT, IT, Scale> &args,
171 Vc_ASSERT_GATHER_PARAMETER_TYPES_;
172 gatherImplementation(args, mask);
176 template <
typename MT,
typename IT,
177 typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>>
178 Vc_INTRINSIC
void gather(
const MT *mem,
const IT &indexes)
180 Vc_ASSERT_GATHER_PARAMETER_TYPES_;
181 gatherImplementation(
182 Common::make_gather<1>(mem, Common::convertIndexVector(indexes)));
186 template <
typename MT,
typename IT,
187 typename = enable_if<Vc::Traits::has_subscript_operator<IT>::value>>
188 Vc_INTRINSIC
void gather(
const MT *mem,
const IT &indexes, MaskArgument mask)
190 Vc_ASSERT_GATHER_PARAMETER_TYPES_;
191 gatherImplementation(
192 Common::make_gather<1>(mem, Common::convertIndexVector(indexes)), mask);
196 #include "gatherinterface_deprecated.h"
204 template <
class MT,
class IT,
int Scale>
206 Vc_INTRINSIC
void gather(
const Common::GatherArguments<MT, IT, Scale> &args)
208 Vc_ASSERT_GATHER_PARAMETER_TYPES_;
209 gatherImplementation(args);
212 template <
class MT,
class IT,
int Scale>
213 Vc_INTRINSIC
void gather(
const Common::GatherArguments<MT, IT, Scale> &args,
216 Vc_ASSERT_GATHER_PARAMETER_TYPES_;
217 gatherImplementation(args, mask);
221 #undef Vc_ASSERT_GATHER_PARAMETER_TYPES_