Blaze  3.6
Pow.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_POW_H_
36 #define _BLAZE_MATH_FUNCTORS_POW_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/shims/Pow.h>
45 #include <blaze/math/simd/Pow.h>
48 #include <blaze/system/Inline.h>
49 
50 
51 namespace blaze {
52 
53 //=================================================================================================
54 //
55 // CLASS DEFINITION
56 //
57 //=================================================================================================
58 
59 //*************************************************************************************************
63 struct Pow
64 {
65  //**********************************************************************************************
72  template< typename T1, typename T2 >
73  BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE decltype(auto) operator()( const T1& a, const T2& b ) const
74  {
75  return pow( a, b );
76  }
77  //**********************************************************************************************
78 
79  //**********************************************************************************************
84  template< typename T1, typename T2 >
85  static constexpr bool simdEnabled() { return HasSIMDPow_v<T1,T2>; }
86  //**********************************************************************************************
87 
88  //**********************************************************************************************
93  static constexpr bool paddingEnabled() { return false; }
94  //**********************************************************************************************
95 
96  //**********************************************************************************************
103  template< typename T1, typename T2 >
104  BLAZE_ALWAYS_INLINE decltype(auto) load( const T1& a, const T2& b ) const
105  {
108  return pow( a, b );
109  }
110  //**********************************************************************************************
111 };
112 //*************************************************************************************************
113 
114 } // namespace blaze
115 
116 #endif
decltype(auto) pow(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise exponential value for the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1271
Header file for the pow shim.
#define BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK(T)
Constraint on the data type.In case the given data type T is not a SIMD pack, a compilation error is ...
Definition: SIMDPack.h:60
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Pow.h:93
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the SIMD power functionality.
Constraint on the data type.
decltype(auto) BLAZE_ALWAYS_INLINE load(const T1 &a, const T2 &b) const
Returns the result of the pow() function for the given SIMD vector.
Definition: Pow.h:104
Generic wrapper for the pow() function.
Definition: Pow.h:63
Header file for the HasSIMDPow type trait.
Macro for CUDA compatibility.
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition: HostDevice.h:94
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data types T1 and T2.
Definition: Pow.h:85
System settings for the inline keywords.