You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
batch<T, A> div(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) {
40
+
inlinebatch<T, A> div(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) {
41
41
returndetail::apply([](T x, T y) -> T { return x / y;}, self, other);
42
42
}
43
43
44
44
// fma
45
-
template<classA, classT> batch<T, A> fma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
45
+
template<classA, classT>
46
+
inline batch<T, A> fma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
46
47
return x * y + z;
47
48
}
48
49
49
-
template<classA, classT> batch<std::complex<T>, A> fma(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) {
50
+
template<classA, classT>
51
+
inline batch<std::complex<T>, A> fma(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) {
50
52
auto res_r = fms(x.real(), y.real(), fms(x.imag(), y.imag(), z.real()));
51
53
auto res_i = fma(x.real(), y.imag(), fma(x.imag(), y.real(), z.imag()));
52
54
return {res_r, res_i};
53
55
}
54
56
55
57
// fms
56
-
template<classA, classT> batch<T, A> fms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
58
+
template<classA, classT>
59
+
inline batch<T, A> fms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
57
60
return x * y - z;
58
61
}
59
62
60
-
template<classA, classT> batch<std::complex<T>, A> fms(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) {
63
+
template<classA, classT>
64
+
inline batch<std::complex<T>, A> fms(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) {
61
65
auto res_r = fms(x.real(), y.real(), fma(x.imag(), y.imag(), z.real()));
62
66
auto res_i = fma(x.real(), y.imag(), fms(x.imag(), y.real(), z.imag()));
63
67
return {res_r, res_i};
64
68
}
65
69
66
70
// fnma
67
-
template<classA, classT> batch<T, A> fnma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
71
+
template<classA, classT>
72
+
inline batch<T, A> fnma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
68
73
return -x * y + z;
69
74
}
70
75
71
-
template<classA, classT> batch<std::complex<T>, A> fnma(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) {
76
+
template<classA, classT>
77
+
inline batch<std::complex<T>, A> fnma(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) {
72
78
auto res_r = - fms(x.real(), y.real(), fma(x.imag(), y.imag(), z.real()));
73
79
auto res_i = - fma(x.real(), y.imag(), fms(x.imag(), y.real(), z.imag()));
74
80
return {res_r, res_i};
75
81
}
76
82
77
83
// fnms
78
-
template<classA, classT> batch<T, A> fnms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
84
+
template<classA, classT>
85
+
inline batch<T, A> fnms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
79
86
return -x * y - z;
80
87
}
81
88
82
-
template<classA, classT> batch<std::complex<T>, A> fnms(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) {
89
+
template<classA, classT>
90
+
inline batch<std::complex<T>, A> fnms(batch<std::complex<T>, A> const& x, batch<std::complex<T>, A> const& y, batch<std::complex<T>, A> const& z, requires_arch<generic>) {
83
91
auto res_r = - fms(x.real(), y.real(), fms(x.imag(), y.imag(), z.real()));
84
92
auto res_i = - fma(x.real(), y.imag(), fma(x.imag(), y.real(), z.imag()));
0 commit comments