23namespace vctr::expressions
26template <
size_t extent,
class SrcType>
32 VCTR_COMMON_UNARY_EXPRESSION_MEMBERS (
Square, src)
34 VCTR_FORCEDINLINE
constexpr value_type operator[] (
size_t i)
const
36 const auto s = src[i];
42 VCTR_FORCEDINLINE
const value_type* evalNextVectorOpInExpressionChain (value_type* dst)
const
45 const auto* s = src.evalNextVectorOpInExpressionChain (dst);
46 Expression::Accelerate::mul (s, s, dst, size());
50 VCTR_FORCEDINLINE
const value_type* evalNextVectorOpInExpressionChain (value_type* dst)
const
53 Expression::Accelerate::square (src.evalNextVectorOpInExpressionChain (dst), dst, size());
57 VCTR_FORCEDINLINE
const value_type* evalNextVectorOpInExpressionChain (value_type* dst)
const
60 const auto* s = src.evalNextVectorOpInExpressionChain (dst);
61 Expression::IPP::mul (s, s, dst,
sizeToInt (size()));
66 VCTR_FORWARD_PREPARE_SIMD_EVALUATION_UNARY_EXPRESSION_MEMBER_FUNCTIONS
72 auto x = src.getAVX (i);
73 return Expression::AVX::mul (x, x);
80 auto x = src.getSSE (i);
81 return Expression::SSE::mul (x, x);
89 auto x = src.getNeon (i);
90 return Expression::Neon::mul (x, x);
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
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 real valued floating point...
Definition: ContainerAndExpressionConcepts.h:260
A combined concept to check if Intel IPP is a suitable option for a real or complex valued floating p...
Definition: ContainerAndExpressionConcepts.h:296
constexpr ExpressionChainBuilder< expressions::Square > square
Squares the source values.
Definition: Square.h:103
The main namespace of the VCTR project.
Definition: Array.h:24
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
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:157
The base class to every expression template.
Definition: ExpressionTemplate.h:37
Definition: NeonRegister.h:28
Definition: SSERegister.h:28