23namespace vctr::expressions
26template <
size_t extent,
class SrcType>
32 VCTR_COMMON_UNARY_EXPRESSION_MEMBERS (
Abs, src)
34 VCTR_FORCEDINLINE
constexpr value_type operator[] (
size_t i)
const
37 return std::abs (src[i]);
40 VCTR_FORCEDINLINE
constexpr value_type operator[] (
size_t i)
const
47 VCTR_FORCEDINLINE
const value_type* evalNextVectorOpInExpressionChain (value_type* dst)
const
48 requires is::suitableForAccelerateRealFloatVectorOp <SrcType, value_type, detail::dontPreferIfIppAndAccelerateAreAvailable> ||
52 Expression::Accelerate::abs (src.evalNextVectorOpInExpressionChain (dst), dst, size());
57 VCTR_FORCEDINLINE
const value_type* evalNextVectorOpInExpressionChain (value_type* dst)
const
58 requires is::suitableForIppRealSingedInt32VectorOp <SrcType, value_type, detail::preferIfIppAndAccelerateAreAvailable> ||
59 is::suitableForIppRealFloatVectorOp <SrcType, value_type, detail::preferIfIppAndAccelerateAreAvailable> ||
63 Expression::IPP::abs (src.evalNextVectorOpInExpressionChain (dst), dst,
sizeToInt (size()));
71 return Expression::Neon::abs (src.getNeon (i));
77 return src.getNeon (i);
84 static const auto avxSignBit = Expression::AVX::broadcast (
typename Expression::CommonElement::Type (-0.0));
86 return Expression::AVX::andNot (avxSignBit, src.getAVX (i));
92 return Expression::AVX::abs (src.getAVX (i));
98 return src.getAVX (i);
105 static const auto sseSignBit = Expression::SSE::broadcast (
typename Expression::CommonElement::Type (-0.0));
107 return Expression::SSE::andNot (sseSignBit, src.getSSE (i));
113 return Expression::SSE::abs (src.getSSE (i));
119 return src.getSSE (i);
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 represent a real valued signed number (e.g.
Definition: NumericTypeConcepts.h:61
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 Intel IPP is a suitable option for a floating point vector operation t...
Definition: ContainerAndExpressionConcepts.h:282
Constrains a type to represent a real valued unsigned integer number.
Definition: NumericTypeConcepts.h:70
constexpr ExpressionChainBuilder< expressions::Abs > abs
Computes the absolute value of the source values.
Definition: Abs.h:133
The main namespace of the VCTR project.
Definition: Array.h:24
typename detail::RealType< std::remove_cvref_t< T > >::Type RealType
If T is any instance of std::complex, this will be the real value_type, otherwise this will be T.
Definition: Traits.h:211
int sizeToInt(size_t size)
Casts the size_t argument to an int.
Definition: PlatformVectorOpsHelpers.h:27
Definition: AVXRegister.h:28
An expression chain builder is an object which supplies various operator<< overloads which build chai...
Definition: ExpressionChainBuilder.h:136
The base class to every expression template.
Definition: ExpressionTemplate.h:37
Definition: NeonRegister.h:28
Definition: SSERegister.h:28