Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
functors
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
43
#include <utility>
44
#include <
blaze/math/constraints/SIMDPack.h
>
45
#include <
blaze/math/shims/Pow.h
>
46
#include <
blaze/math/simd/Pow.h
>
47
#include <
blaze/math/typetraits/HasSIMDPow.h
>
48
#include <
blaze/system/HostDevice.h
>
49
#include <
blaze/system/Inline.h
>
50
51
52
namespace
blaze {
53
54
//=================================================================================================
55
//
56
// CLASS DEFINITION
57
//
58
//=================================================================================================
59
60
//*************************************************************************************************
64
struct
Pow
65
{
66
//**********************************************************************************************
73
template
<
typename
T1,
typename
T2 >
74
BLAZE_ALWAYS_INLINE
BLAZE_DEVICE_CALLABLE
decltype
(
auto
)
operator
()( T1&& a, T2&& b )
const
75
{
76
return
pow
( std::forward<T1>( a ), std::forward<T2>( b ) );
77
}
78
//**********************************************************************************************
79
80
//**********************************************************************************************
85
template
<
typename
T1,
typename
T2 >
86
static
constexpr
bool
simdEnabled
() {
return
HasSIMDPow_v<T1,T2>
; }
87
//**********************************************************************************************
88
89
//**********************************************************************************************
94
static
constexpr
bool
paddingEnabled
() {
return
false
; }
95
//**********************************************************************************************
96
97
//**********************************************************************************************
104
template
<
typename
T1,
typename
T2 >
105
BLAZE_ALWAYS_INLINE
decltype
(
auto
)
load
(
const
T1& a,
const
T2& b )
const
106
{
107
BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK
( T1 );
108
BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK
( T2 );
109
return
pow
( a, b );
110
}
111
//**********************************************************************************************
112
};
113
//*************************************************************************************************
114
115
}
// namespace blaze
116
117
#endif
HasSIMDPow.h
Header file for the HasSIMDPow type trait.
HostDevice.h
Macro for CUDA compatibility.
SIMDPack.h
Constraint on the data type.
blaze::pow
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:1448
BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK
#define BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK(T)
Constraint on the data type.
Definition
SIMDPack.h:60
blaze::HasSIMDPow_v
constexpr bool HasSIMDPow_v
Auxiliary variable template for the HasSIMDPow type trait.
Definition
HasSIMDPow.h:124
BLAZE_ALWAYS_INLINE
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition
Inline.h:85
BLAZE_DEVICE_CALLABLE
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition
HostDevice.h:94
Pow.h
Header file for the pow shim.
Pow.h
Header file for the SIMD power functionality.
blaze::Pow
Generic wrapper for the pow() function.
Definition
Pow.h:65
blaze::Pow::paddingEnabled
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition
Pow.h:94
blaze::Pow::simdEnabled
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data types T1 and T2.
Definition
Pow.h:86
blaze::Pow::load
BLAZE_ALWAYS_INLINE decltype(auto) load(const T1 &a, const T2 &b) const
Returns the result of the pow() function for the given SIMD vector.
Definition
Pow.h:105
Inline.h
System settings for the inline keywords.
Generated by
1.18.0