14 T inf = std::numeric_limits<T>::max();
15 if (a == inf || b == inf){
23 template <
class T1,
class T2>
30 return (static_cast<T_promote>(arg1) +
31 static_cast<T_promote>(arg2) );
35 return (static_cast<T_promote>(arg1) *
36 static_cast<T_promote>(arg2) );
51 template<
int Begin,
int End,
int Step>
53 template<
typename Lambda>
54 static void step(Lambda& func) {
60 template<
int End,
int Step>
62 template<
typename Lambda>
63 static void step(Lambda& func) {
70 template<
class T1,
class T2,
unsigned D>
76 static void axpy(
const array<T2, D> & b, array<T_promote, D> & c)
78 const T2 * __restrict barr = b.data();
80 __assume_aligned(barr,
ALIGN);
81 __assume_aligned(carr,
ALIGN);
84 for(
int i=0; i<D; ++i)
93 static void axpy(T1 a,
const array<T2,D> & b, array<T_promote,D> & c)
95 const T2 * __restrict barr = b.data();
97 __assume_aligned(barr,
ALIGN);
98 __assume_aligned(carr,
ALIGN);
101 for(
int i=0; i<D; ++i)
103 carr[i] += a* barr[i];
111 template <
class T1,
class T2>
118 return std::min<T_promote>
119 (
static_cast<T_promote>(arg1), static_cast<T_promote>(arg2));
124 (
static_cast<T_promote>(arg1), static_cast<T_promote>(arg2));
static void axpy(T1 a, const array< T2, D > &b, array< T_promote, D > &c)
static void step(Lambda &func)
promote_trait< T1, T2 >::T_promote T_promote
static void step(Lambda &func)
static void axpy(T1 a, const T2 &x, T_promote &y)
static void axpy(const array< T2, D > &b, array< T_promote, D > &c)
T operator()(const T &a, const T &b) const
static T_promote add(const T1 &arg1, const T2 &arg2)
promote_trait< T1, T2 >::T_promote T_promote
promote_trait< T1, T2 >::T_promote T_promote
static void axpy(const T2 &x, T_promote &y)
static T_promote multiply(const T1 &arg1, const T2 &arg2)
static T_promote add(const T1 &arg1, const T2 &arg2)
static T_promote multiply(const T1 &arg1, const T2 &arg2)