28struct AnyVctr : std::false_type {};
30template <
class T,
template <
class>
class A>
31struct AnyVctr<Vector<T, A>> : std::true_type {};
34struct AnyVctr<OwnedVector<T>> : std::true_type {};
36template <
class T,
size_t e,
size_t s>
37struct AnyVctr<Array<T, e, s>> : std::true_type {};
39template <
class T,
size_t e>
40struct AnyVctr<OwnedArray<T, e>> : std::true_type {};
42template <
class T,
size_t n,
class S>
43struct AnyVctr<Span<T, n, S>> : std::true_type {};
45template <
class E,
class S,
size_t e,
class I>
46struct AnyVctr<VctrBase<E, S, e, I>> : std::true_type {};
49struct IsSpan : std::false_type {};
51template <
class T,
size_t n,
class S>
52struct IsSpan<Span<T, n, S>> : std::true_type {};
55struct IsStdArray : std::false_type {};
57template <
class T,
size_t e>
58struct IsStdArray<std::array<T, e>> : std::true_type {};
61struct IsStdSpan : std::false_type {};
63template <
class T,
size_t e>
64struct IsStdSpan<std::span<T, e>> : std::true_type {};
67struct IsExpressionChainBuilder : std::false_type {};
69template <
template <size_t,
class...>
class ExpressionType,
class RuntimeArgs,
class... AdditionalParameters>
70struct IsExpressionChainBuilder<ExpressionChainBuilderWithRuntimeArgs<ExpressionType, RuntimeArgs, AdditionalParameters...>> : std::true_type {};
84concept getNeon =
requires (
const T& t,
size_t i) { t.getNeon (i); };
92concept getAVX =
requires (
const T& t,
size_t i) { t.getAVX (i); };
100concept getSSE =
requires (
const T& t,
size_t i) { t.getSSE (i); };
111template <
class T,
class DstType>
112concept evalNextVectorOpInExpressionChain =
requires (
const T& t, DstType* d) { t.evalNextVectorOpInExpressionChain (d); } && std::same_as<DstType, typename std::remove_cvref_t<T>::value_type>;
115template <
class T,
class ValueType>
119template <
class T,
class DstType>
120concept reduceVectorOp =
requires (
const T& t) { { t.reduceVectorOp() } -> std::same_as<DstType>; };
123template <
class T,
class SrcDstType>
124concept reduceNeonRegisterWise =
requires (
const T& t, NeonRegister<SrcDstType>& sd,
size_t s) { t.reduceNeonRegisterWise (sd, s); };
127template <
class T,
class SrcDstType>
128concept reduceAVXRegisterWise =
requires (
const T& t, AVXRegister<SrcDstType>& sd,
size_t s) { t.reduceAVXRegisterWise (sd, s); };
131template <
class T,
class SrcDstType>
132concept reduceSSERegisterWise =
requires (
const T& t, SSERegister<SrcDstType>& sd,
size_t s) { t.reduceSSERegisterWise (sd, s); };
136concept data =
requires (
const T& t) { t.data(); };
139template <
class T,
class ElementType>
140concept dataWithElementType =
requires (
const T& t) { { t.data() } -> std::convertible_to<const ElementType*>; };
144concept size =
requires (
const T& t,
size_t i) { i = t.size(); };
151template <
class T,
class ElementType>
156concept begin =
requires (T& t) { *t.begin(); } ||
requires (
const T& t) { *t.begin(); };
160concept end =
requires (T& t) { *t.end(); } ||
requires (
const T& t) { *t.begin(); };
164concept resize =
requires (T& t,
size_t n) { t.resize (n); };
172concept isNotAliased =
requires (
const T& t,
bool r,
const void* o) { r = t.isNotAliased (o); };
175template <
class T,
size_t i,
class RuntimeArgs>
179template <
class T,
class... Args>
180concept applyRuntimeArgs =
requires (T& t,
const Args&... args) { t.applyRuntimeArgs (args...); };
184namespace vctr::detail
192enum PlatformVectorOpPreference
194 dontPreferIfIppAndAccelerateAreAvailable,
195 preferIfIppAndAccelerateAreAvailable
198template <PlatformVectorOpPreference pref>
199concept isPreferredVectorOp = (Config::hasIPP && Config::platformApple && (pref == preferIfIppAndAccelerateAreAvailable)) ||
200 ((! (Config::hasIPP && Config::platformApple)) && (pref == dontPreferIfIppAndAccelerateAreAvailable));
210concept anyVctr = detail::AnyVctr<std::remove_cvref_t<T>>::value;
213template <
class T,
class V>
221template <
class T,
class V>
242concept view = detail::IsSpan<T>::value || detail::IsStdSpan<T>::value;
246template <
class T,
class DstType>
251template <
class DstType,
class... Sources>
255template <
class DstType,
class... Sources>
259template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
263template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
267template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
271template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
275template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
279template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
283template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
287template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
291template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
295template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
299template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
303template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
307template <
class Src,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
312template <
class SrcA,
class SrcB,
class DstType>
314 (
anyVctr<SrcA> && expressionWithEvalVectorOp < SrcB, DstType >) ||
316 std::same_as<typename std::remove_cvref_t<SrcA>::value_type,
typename std::remove_cvref_t<SrcB>::value_type>;
320template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
324template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
328template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
333template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
337template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
341template <
class SrcA,
class SrcB,
class DstType, detail::PlatformVectorOpPreference pref = detail::preferIfIppAndAccelerateAreAvailable>
356template <
class T,
class ElementType>
368template <
class T,
class ElementType>
372template <
class T,
class ElementType>
376template <
class T,
class ElementType>
384concept storageInfo =
requires (
const T& info,
size_t a,
bool b) { a = T::memberAlignment; b = info.dataIsSIMDAligned; b = info.hasSIMDExtendedStorage; };
387concept 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:398
Constrains a type to have a function applyRuntimeArgs (const Args&...)
Definition: ContainerAndExpressionConcepts.h:180
Constrains a type to have a member function begin() or begin() const.
Definition: ContainerAndExpressionConcepts.h:156
Constrains a type to have a const operator[] overload taking a size_t argument.
Definition: ContainerAndExpressionConcepts.h:108
Constrains a type to have a member function data() const returning a pointer convertible to const Ele...
Definition: ContainerAndExpressionConcepts.h:140
Constrains a type to have a member function data() const.
Definition: ContainerAndExpressionConcepts.h:136
Constrains a type to have a member function end() or end() const.
Definition: ContainerAndExpressionConcepts.h:160
Constrains a type to have a member function evalNextVectorOpInExpressionChain (value_type*) const.
Definition: ContainerAndExpressionConcepts.h:112
Constrains a type to have a member function getAVX (size_t) const.
Definition: ContainerAndExpressionConcepts.h:92
Constrains a type to have a member function getNeon (size_t) const.
Definition: ContainerAndExpressionConcepts.h:84
Constrains a type to have a member function getSSE (size_t) const.
Definition: ContainerAndExpressionConcepts.h:100
Constrains a type to have a function getStorageInfo() const.
Definition: ContainerAndExpressionConcepts.h:168
Constrains a type to have a non const operator[] overload taking a size_t argument.
Definition: ContainerAndExpressionConcepts.h:104
Constrains a type to have a function isNotAliased (const void*) const.
Definition: ContainerAndExpressionConcepts.h:172
Constrains a type to have a function iterateOverRuntimeArgChain<size_t> (RuntimeArgs)
Definition: ContainerAndExpressionConcepts.h:176
Constrains a type to have a member function prepareAVXEvaluation() const.
Definition: ContainerAndExpressionConcepts.h:88
Constrains a type to have a member function prepareNeonEvaluation() const.
Definition: ContainerAndExpressionConcepts.h:80
Constrains a type to have a member function prepareSSEEvaluation() const.
Definition: ContainerAndExpressionConcepts.h:96
Constrains a type to have a member function reduceAVXRegisterWise (AVXRegister<SrcDstType>&,...
Definition: ContainerAndExpressionConcepts.h:128
Constrains a type to have a member function reduceElementWise() const that takes a ValueType& and siz...
Definition: ContainerAndExpressionConcepts.h:116
Constrains a type to have a member function reduceNeonRegisterWise (NeonRegister<SrcDstType>&,...
Definition: ContainerAndExpressionConcepts.h:124
Constrains a type to have a member function reduceSSERegisterWise (SSERegister<SrcDstType>&,...
Definition: ContainerAndExpressionConcepts.h:132
Constrains a type to have a member function reduceVectorOp() const that returns a DstType value.
Definition: ContainerAndExpressionConcepts.h:120
Constrains a type to have a function resize (size_t).
Definition: ContainerAndExpressionConcepts.h:164
Constrains a type to both, a member function size() const and data() const returning a pointer conver...
Definition: ContainerAndExpressionConcepts.h:152
Constrains a type to both, a member function size() const and data() const.
Definition: ContainerAndExpressionConcepts.h:148
Constrains a type to have a member function size() const.
Definition: ContainerAndExpressionConcepts.h:144
Constrains a type to either be an expression template or any derived instance of VctrBase.
Definition: ContainerAndExpressionConcepts.h:230
Constrains a type to be any derived instance of VctrBase with a certain value_type.
Definition: ContainerAndExpressionConcepts.h:214
Constrains a type to be any derived instance of VctrBase.
Definition: ContainerAndExpressionConcepts.h:210
Constrains a type to represent a complex valued floating point number (e.g.
Definition: NumericTypeConcepts.h:87
Constrains the type to be a contiguous iterator with a value type same as ElementType.
Definition: ContainerAndExpressionConcepts.h:377
Constrains a type to be an expression chain builder.
Definition: ContainerAndExpressionConcepts.h:226
Constrains a type to be an expression template that defines evalNextVectorOpInExpressionChain for Dst...
Definition: ContainerAndExpressionConcepts.h:247
Constrains a type to be an expression template with a certain value_type.
Definition: ContainerAndExpressionConcepts.h:222
Constrains a type to be an expression template.
Definition: ContainerAndExpressionConcepts.h:218
Constrains a type to represent a real valued integer number.
Definition: NumericTypeConcepts.h:53
Constrains a type to supply begin and end functions and to not satisfy triviallyCopyableWithDataAndSi...
Definition: ContainerAndExpressionConcepts.h:351
Constrains a type to represent a real valued floating point number.
Definition: NumericTypeConcepts.h:83
Definition: ContainerAndExpressionConcepts.h:387
Constrains a type to be any instance of std::array.
Definition: ContainerAndExpressionConcepts.h:234
Constrains a type to be any instance of std::span.
Definition: ContainerAndExpressionConcepts.h:238
Constrains the type to be a suitable storage info type.
Definition: ContainerAndExpressionConcepts.h:384
A combined concept to check if Apple Accelerate is a suitable option for a complex valued floating po...
Definition: ContainerAndExpressionConcepts.h:325
A combined concept to check if Apple Accelerate is a suitable option for a complex valued floating po...
Definition: ContainerAndExpressionConcepts.h:264
A combined concept to check if Apple Accelerate is a suitable option for a floating point vector oper...
Definition: ContainerAndExpressionConcepts.h:272
A combined concept to check if Apple Accelerate vpf functions are suitable to work on Neon registers.
Definition: ContainerAndExpressionConcepts.h:256
A combined concept to check if Apple Accelerate is a suitable option for a real valued floating point...
Definition: ContainerAndExpressionConcepts.h:321
A combined concept to check if Apple Accelerate is a suitable option for a real valued floating point...
Definition: ContainerAndExpressionConcepts.h:260
A combined concept to check if Apple Accelerate is a suitable option for a floating point vector redu...
Definition: ContainerAndExpressionConcepts.h:280
A combined concept to check if Apple Accelerate is a suitable option for a vector operation that tran...
Definition: ContainerAndExpressionConcepts.h:276
A combined concept to check if Apple Accelerate is a suitable option for a real or complex valued flo...
Definition: ContainerAndExpressionConcepts.h:329
A combined concept to check if Apple Accelerate is a suitable option for a real or complex valued flo...
Definition: ContainerAndExpressionConcepts.h:268
A combined concept to check if Apple Accelerate vpf functions are suitable to work on SSE registers.
Definition: ContainerAndExpressionConcepts.h:252
Constrains two source types to be suitable for a an aliasing-free binary vector operation using platf...
Definition: ContainerAndExpressionConcepts.h:313
A combined concept to check if Intel IPP is a suitable option for a complex valued floating point bin...
Definition: ContainerAndExpressionConcepts.h:338
A combined concept to check if Intel IPP is a suitable option for a complex valued floating point vec...
Definition: ContainerAndExpressionConcepts.h:292
A combined concept to check if Intel IPP is a suitable option for a floating point vector operation t...
Definition: ContainerAndExpressionConcepts.h:300
A combined concept to check if Intel IPP is a suitable option for a real valued floating point binary...
Definition: ContainerAndExpressionConcepts.h:334
A combined concept to check if Intel IPP is a suitable option for a real valued floating point vector...
Definition: ContainerAndExpressionConcepts.h:284
A combined concept to check if Intel IPP is a suitable option for a floating point vector reduction o...
Definition: ContainerAndExpressionConcepts.h:304
A combined concept to check if Intel IPP is a suitable option for a real or complex valued floating p...
Definition: ContainerAndExpressionConcepts.h:342
A combined concept to check if Intel IPP is a suitable option for a real or complex valued floating p...
Definition: ContainerAndExpressionConcepts.h:296
A combined concept to check if Intel IPP is a suitable option for a real or complex floating point ve...
Definition: ContainerAndExpressionConcepts.h:308
A combined concept to check if Intel IPP is a suitable option for a real valued singed int32 vector o...
Definition: ContainerAndExpressionConcepts.h:288
Constrains the type to be suitable for initializing a single element Vctr with a given ElementType,...
Definition: ContainerAndExpressionConcepts.h:357
Constrains the type to be a function suitable for initializing the nth element of a Vctr with a given...
Definition: ContainerAndExpressionConcepts.h:369
Constrains the type to be a function suitable for initializing the nth element of a Vctr,...
Definition: ContainerAndExpressionConcepts.h:363
Constrains a type to supply a data and size function, an index operator and define a trivially copyab...
Definition: ContainerAndExpressionConcepts.h:347
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:242
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