28struct AnyVctr : std::false_type {};
30template <
class T,
template <
class>
class A>
31struct AnyVctr<Vector<T, A>> : std::true_type {};
33template <
class T,
size_t e,
size_t s>
34struct AnyVctr<Array<T, e, s>> : std::true_type {};
36template <
class T,
size_t n,
class S>
37struct AnyVctr<Span<T, n, S>> : std::true_type {};
39template <
class E,
class S,
size_t e,
class I>
40struct AnyVctr<VctrBase<E, S, e, I>> : std::true_type {};
43struct IsSpan : std::false_type {};
45template <
class T,
size_t n,
class S>
46struct IsSpan<Span<T, n, S>> : std::true_type {};
49struct IsStdArray : std::false_type {};
51template <
class T,
size_t e>
52struct IsStdArray<std::array<T, e>> : std::true_type {};
55struct IsStdSpan : std::false_type {};
57template <
class T,
size_t e>
58struct IsStdSpan<std::span<T, e>> : std::true_type {};
61struct IsExpressionChainBuilder : std::false_type {};
63template <
template <size_t,
class...>
class ExpressionType,
class RuntimeArgs,
class... AdditionalParameters>
64struct IsExpressionChainBuilder<ExpressionChainBuilderWithRuntimeArgs<ExpressionType, RuntimeArgs, AdditionalParameters...>> : std::true_type {};
74concept getNeon =
requires (
const T& t,
size_t i) { t.getNeon (i); };
78concept getAVX =
requires (
const T& t,
size_t i) { t.getAVX (i); };
82concept getSSE =
requires (
const T& t,
size_t i) { t.getSSE (i); };
93template <
class T,
class DstType>
94concept evalNextVectorOpInExpressionChain =
requires (
const T& t, DstType* d) { t.evalNextVectorOpInExpressionChain (d); } && std::same_as<DstType, typename std::remove_cvref_t<T>::value_type>;
97template <
class T,
class ValueType>
101template <
class T,
class DstType>
102concept reduceVectorOp =
requires (
const T& t) { { t.reduceVectorOp() } -> std::same_as<DstType>; };
105template <
class T,
class SrcDstType>
106concept reduceNeonRegisterWise =
requires (
const T& t, NeonRegister<SrcDstType>& sd,
size_t s) { t.reduceNeonRegisterWise (sd, s); };
109template <
class T,
class SrcDstType>
110concept reduceAVXRegisterWise =
requires (
const T& t, AVXRegister<SrcDstType>& sd,
size_t s) { t.reduceAVXRegisterWise (sd, s); };
113template <
class T,
class SrcDstType>
114concept reduceSSERegisterWise =
requires (
const T& t, SSERegister<SrcDstType>& sd,
size_t s) { t.reduceSSERegisterWise (sd, s); };
118concept data =
requires (
const T& t) { t.data(); };
121template <
class T,
class ElementType>
122concept dataWithElementType =
requires (
const T& t) { { t.data() } -> std::convertible_to<const ElementType*>; };
126concept size =
requires (
const T& t,
size_t i) { i = t.size(); };
133template <
class T,
class ElementType>
138concept begin =
requires (T& t) { *t.begin(); } ||
requires (
const T& t) { *t.begin(); };
142concept end =
requires (T& t) { *t.end(); } ||
requires (
const T& t) { *t.begin(); };
146concept resize =
requires (T& t,
size_t n) { t.resize (n); };
154concept isNotAliased =
requires (
const T& t,
bool r,
const void* o) { r = t.isNotAliased (o); };
157template <
class T,
size_t i,
class RuntimeArgs>
161template <
class T,
class... Args>
162concept applyRuntimeArgs =
requires (T& t,
const Args&... args) { t.applyRuntimeArgs (args...); };
166namespace vctr::detail
174enum PlatformVectorOpPreference
176 dontPreferIfIppAndAccelerateAreAvailable,
177 preferIfIppAndAccelerateAreAvailable
180template <PlatformVectorOpPreference pref>
181concept isPreferredVectorOp = (Config::hasIPP && Config::platformApple && (pref == preferIfIppAndAccelerateAreAvailable)) ||
182 ((! (Config::hasIPP && Config::platformApple)) && (pref == dontPreferIfIppAndAccelerateAreAvailable));
192concept anyVctr = detail::AnyVctr<std::remove_cvref_t<T>>::value;
195template <
class T,
class V>
203template <
class T,
class V>
224concept view = detail::IsSpan<T>::value || detail::IsStdSpan<T>::value;
228template <
class T,
class DstType>
233template <
class DstType,
class... Sources>
237template <
class DstType,
class... Sources>
241template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
245template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
249template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
253template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
257template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
261template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
265template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
269template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
273template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
277template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
281template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
285template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
289template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
294template <
class SrcA,
class SrcB,
class DstType>
296 (
anyVctr<SrcA> && expressionWithEvalVectorOp < SrcB, DstType >) ||
298 std::same_as<typename std::remove_cvref_t<SrcA>::value_type,
typename std::remove_cvref_t<SrcB>::value_type>;
302template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
306template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
310template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
315template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
319template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
323template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
338template <
class T,
class ElementType>
350template <
class T,
class ElementType>
354template <
class T,
class ElementType>
358template <
class T,
class ElementType>
366concept storageInfo =
requires (
const T& info,
size_t a,
bool b) { a = T::memberAlignment; b = info.dataIsSIMDAligned; b = info.hasSIMDExtendedStorage; };
369concept reductionExpression =
requires (
const T& t,
typename T::value_type v,
size_t i) { v = T::reductionResultInitValue; t.reduceElementWise (v, i); };
Constrains a pack of types to be no expression templates.
Definition: ContainerAndExpressionConcepts.h:380
Constrains a type to have a function applyRuntimeArgs (const Args&...)
Definition: ContainerAndExpressionConcepts.h:162
Constrains a type to have a member function begin() or begin() const.
Definition: ContainerAndExpressionConcepts.h:138
Constrains a type to have a const operator[] overload taking a size_t argument.
Definition: ContainerAndExpressionConcepts.h:90
Constrains a type to have a member function data() const returning a pointer convertible to const Ele...
Definition: ContainerAndExpressionConcepts.h:122
Constrains a type to have a member function data() const.
Definition: ContainerAndExpressionConcepts.h:118
Constrains a type to have a member function end() or end() const.
Definition: ContainerAndExpressionConcepts.h:142
Constrains a type to have a member function evalNextVectorOpInExpressionChain (value_type*) const.
Definition: ContainerAndExpressionConcepts.h:94
Constrains a type to have a member function getAVX (size_t) const.
Definition: ContainerAndExpressionConcepts.h:78
Constrains a type to have a member function getNeon (size_t) const.
Definition: ContainerAndExpressionConcepts.h:74
Constrains a type to have a member function getSSE (size_t) const.
Definition: ContainerAndExpressionConcepts.h:82
Constrains a type to have a function getStorageInfo() const.
Definition: ContainerAndExpressionConcepts.h:150
Constrains a type to have a non const operator[] overload taking a size_t argument.
Definition: ContainerAndExpressionConcepts.h:86
Constrains a type to have a function isNotAliased (const void*) const.
Definition: ContainerAndExpressionConcepts.h:154
Constrains a type to have a function iterateOverRuntimeArgChain<size_t> (RuntimeArgs)
Definition: ContainerAndExpressionConcepts.h:158
Constrains a type to have a member function reduceAVXRegisterWise (AVXRegister<SrcDstType>&,...
Definition: ContainerAndExpressionConcepts.h:110
Constrains a type to have a member function reduceElementWise() const that takes a ValueType& and siz...
Definition: ContainerAndExpressionConcepts.h:98
Constrains a type to have a member function reduceNeonRegisterWise (NeonRegister<SrcDstType>&,...
Definition: ContainerAndExpressionConcepts.h:106
Constrains a type to have a member function reduceSSERegisterWise (SSERegister<SrcDstType>&,...
Definition: ContainerAndExpressionConcepts.h:114
Constrains a type to have a member function reduceVectorOp() const that returns a DstType value.
Definition: ContainerAndExpressionConcepts.h:102
Constrains a type to have a function resize (size_t).
Definition: ContainerAndExpressionConcepts.h:146
Constrains a type to both, a member function size() const and data() const returning a pointer conver...
Definition: ContainerAndExpressionConcepts.h:134
Constrains a type to both, a member function size() const and data() const.
Definition: ContainerAndExpressionConcepts.h:130
Constrains a type to have a member function size() const.
Definition: ContainerAndExpressionConcepts.h:126
Constrains a type to either be an expression template or any derived instance of VctrBase.
Definition: ContainerAndExpressionConcepts.h:212
Constrains a type to be any derived instance of VctrBase with a certain value_type.
Definition: ContainerAndExpressionConcepts.h:196
Constrains a type to be any derived instance of VctrBase.
Definition: ContainerAndExpressionConcepts.h:192
Constrains a type to represent a complex valued floating point number (e.g.
Definition: NumericTypeConcepts.h:83
Constrains the type to be a contiguous iterator with a value type same as ElementType.
Definition: ContainerAndExpressionConcepts.h:359
Constrains a type to be an expression chain builder.
Definition: ContainerAndExpressionConcepts.h:208
Constrains a type to be an expression template that defines evalNextVectorOpInExpressionChain for Dst...
Definition: ContainerAndExpressionConcepts.h:229
Constrains a type to be an expression template with a certain value_type.
Definition: ContainerAndExpressionConcepts.h:204
Constrains a type to be an expression template.
Definition: ContainerAndExpressionConcepts.h:200
Constrains a type to represent a real valued integer number.
Definition: NumericTypeConcepts.h:49
Constrains a type to supply begin and end functions and to not satisfy triviallyCopyableWithDataAndSi...
Definition: ContainerAndExpressionConcepts.h:333
Constrains a type to represent a real valued floating point number.
Definition: NumericTypeConcepts.h:79
Definition: ContainerAndExpressionConcepts.h:369
Constrains a type to be any instance of std::array.
Definition: ContainerAndExpressionConcepts.h:216
Constrains a type to be any instance of std::span.
Definition: ContainerAndExpressionConcepts.h:220
Constrains the type to be a suitable storage info type.
Definition: ContainerAndExpressionConcepts.h:366
A combined concept to check if Apple Accelerate is a suitable option for a complex valued floating po...
Definition: ContainerAndExpressionConcepts.h:307
A combined concept to check if Apple Accelerate is a suitable option for a complex valued floating po...
Definition: ContainerAndExpressionConcepts.h:246
A combined concept to check if Apple Accelerate is a suitable option for a floating point vector oper...
Definition: ContainerAndExpressionConcepts.h:254
A combined concept to check if Apple Accelerate vpf functions are suitable to work on Neon registers.
Definition: ContainerAndExpressionConcepts.h:238
A combined concept to check if Apple Accelerate is a suitable option for a real valued floating point...
Definition: ContainerAndExpressionConcepts.h:303
A combined concept to check if Apple Accelerate is a suitable option for a real valued floating point...
Definition: ContainerAndExpressionConcepts.h:242
A combined concept to check if Apple Accelerate is a suitable option for a floating point vector redu...
Definition: ContainerAndExpressionConcepts.h:262
A combined concept to check if Apple Accelerate is a suitable option for a vector operation that tran...
Definition: ContainerAndExpressionConcepts.h:258
A combined concept to check if Apple Accelerate is a suitable option for a real or complex valued flo...
Definition: ContainerAndExpressionConcepts.h:311
A combined concept to check if Apple Accelerate is a suitable option for a real or complex valued flo...
Definition: ContainerAndExpressionConcepts.h:250
A combined concept to check if Apple Accelerate vpf functions are suitable to work on SSE registers.
Definition: ContainerAndExpressionConcepts.h:234
Constrains two source types to be suitable for a an aliasing-free binary vector operation using platf...
Definition: ContainerAndExpressionConcepts.h:295
A combined concept to check if Intel IPP is a suitable option for a complex valued floating point bin...
Definition: ContainerAndExpressionConcepts.h:320
A combined concept to check if Intel IPP is a suitable option for a complex valued floating point vec...
Definition: ContainerAndExpressionConcepts.h:274
A combined concept to check if Intel IPP is a suitable option for a floating point vector operation t...
Definition: ContainerAndExpressionConcepts.h:282
A combined concept to check if Intel IPP is a suitable option for a real valued floating point binary...
Definition: ContainerAndExpressionConcepts.h:316
A combined concept to check if Intel IPP is a suitable option for a real valued floating point vector...
Definition: ContainerAndExpressionConcepts.h:266
A combined concept to check if Intel IPP is a suitable option for a floating point vector reduction o...
Definition: ContainerAndExpressionConcepts.h:286
A combined concept to check if Intel IPP is a suitable option for a real or complex valued floating p...
Definition: ContainerAndExpressionConcepts.h:324
A combined concept to check if Intel IPP is a suitable option for a real or complex valued floating p...
Definition: ContainerAndExpressionConcepts.h:278
A combined concept to check if Intel IPP is a suitable option for a real or complex floating point ve...
Definition: ContainerAndExpressionConcepts.h:290
A combined concept to check if Intel IPP is a suitable option for a real valued singed int32 vector o...
Definition: ContainerAndExpressionConcepts.h:270
Constrains the type to be suitable for initializing a single element Vctr with a given ElementType,...
Definition: ContainerAndExpressionConcepts.h:339
Constrains the type to be a function suitable for initializing the nth element of a Vctr with a given...
Definition: ContainerAndExpressionConcepts.h:351
Constrains the type to be a function suitable for initializing the nth element of a Vctr,...
Definition: ContainerAndExpressionConcepts.h:345
Constrains a type to supply a data and size function, an index operator and define a trivially copyab...
Definition: ContainerAndExpressionConcepts.h:329
Constrains a type to be trivially copyable.
Definition: GenericConcepts.h:84
Constrains a type to be a view rather than an owning container.
Definition: ContainerAndExpressionConcepts.h:224
typename detail::ValueType< std::remove_cvref_t< T > >::Type ValueType
If T is an expression template, it equals its return type, if it's a type that defines value_type as ...
Definition: Traits.h:201