Skip to content

Commit 2591a43

Browse files
committed
requires -> requires_arch
1 parent 7183ba4 commit 2591a43

25 files changed

+974
-1418
lines changed

include-refactoring/xsimd/arch/generic/xsimd_generic_arithmetic.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,61 +12,61 @@ namespace xsimd {
1212

1313
// bitwise_lshift
1414
template<class A, class T, class/*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
15-
batch<T, A> bitwise_lshift(batch<T, A> const& self, batch<T, A> const& other, requires<generic>) {
15+
batch<T, A> bitwise_lshift(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) {
1616
return detail::apply([](T x, T y) { return x << y;}, self, other);
1717
}
1818

1919
// bitwise_rshift
2020
template<class A, class T, class/*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
21-
batch<T, A> bitwise_rshift(batch<T, A> const& self, batch<T, A> const& other, requires<generic>) {
21+
batch<T, A> bitwise_rshift(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) {
2222
return detail::apply([](T x, T y) { return x >> y;}, self, other);
2323
}
2424

2525
// div
2626
template<class A, class T, class=typename std::enable_if<std::is_integral<T>::value, void>::type>
27-
batch<T, A> div(batch<T, A> const& self, batch<T, A> const& other, requires<generic>) {
27+
batch<T, A> div(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) {
2828
return detail::apply([](T x, T y) -> T { return x / y;}, self, other);
2929
}
3030

3131
// fma
32-
template<class A, class T> batch<T, A> fma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires<generic>) {
32+
template<class A, class T> batch<T, A> fma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
3333
return x * y + z;
3434
}
3535

36-
template<class A, class T> 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<generic>) {
36+
template<class A, class T> 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>) {
3737
auto res_r = fms(x.real(), y.real(), fms(x.imag(), y.imag(), z.real()));
3838
auto res_i = fma(x.real(), y.imag(), fma(x.imag(), y.real(), z.imag()));
3939
return {res_r, res_i};
4040
}
4141

4242
// fms
43-
template<class A, class T> batch<T, A> fms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires<generic>) {
43+
template<class A, class T> batch<T, A> fms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
4444
return x * y - z;
4545
}
4646

47-
template<class A, class T> 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<generic>) {
47+
template<class A, class T> 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>) {
4848
auto res_r = fms(x.real(), y.real(), fma(x.imag(), y.imag(), z.real()));
4949
auto res_i = fma(x.real(), y.imag(), fms(x.imag(), y.real(), z.imag()));
5050
return {res_r, res_i};
5151
}
5252

5353
// fnma
54-
template<class A, class T> batch<T, A> fnma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires<generic>) {
54+
template<class A, class T> batch<T, A> fnma(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
5555
return -x * y + z;
5656
}
5757

58-
template<class A, class T> 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<generic>) {
58+
template<class A, class T> 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>) {
5959
auto res_r = - fms(x.real(), y.real(), fma(x.imag(), y.imag(), z.real()));
6060
auto res_i = - fma(x.real(), y.imag(), fms(x.imag(), y.real(), z.imag()));
6161
return {res_r, res_i};
6262
}
6363

6464
// fnms
65-
template<class A, class T> batch<T, A> fnms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires<generic>) {
65+
template<class A, class T> batch<T, A> fnms(batch<T, A> const& x, batch<T, A> const& y, batch<T, A> const& z, requires_arch<generic>) {
6666
return -x * y - z;
6767
}
6868

69-
template<class A, class T> 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<generic>) {
69+
template<class A, class T> 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>) {
7070
auto res_r = - fms(x.real(), y.real(), fms(x.imag(), y.imag(), z.real()));
7171
auto res_i = - fma(x.real(), y.imag(), fma(x.imag(), y.real(), z.imag()));
7272
return {res_r, res_i};
@@ -76,7 +76,7 @@ namespace xsimd {
7676

7777
// mul
7878
template<class A, class T, class/*=typename std::enable_if<std::is_integral<T>::value, void>::type*/>
79-
batch<T, A> mul(batch<T, A> const& self, batch<T, A> const& other, requires<generic>) {
79+
batch<T, A> mul(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) {
8080
return detail::apply([](T x, T y) -> T { return x * y;}, self, other);
8181
}
8282

include-refactoring/xsimd/arch/generic/xsimd_generic_complex.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ namespace xsimd {
1212

1313
// arg
1414
template<class A, class T>
15-
batch<T, A> arg(batch<std::complex<T>, A> const& self, requires<generic>) {
15+
batch<T, A> arg(batch<std::complex<T>, A> const& self, requires_arch<generic>) {
1616
return atan2(self.imag(), self.real());
1717
}
1818

1919

2020
// conj
21-
template<class A, class T> batch<std::complex<T>, A> conj(batch<std::complex<T>, A> const& self, requires<generic>) {
21+
template<class A, class T> batch<std::complex<T>, A> conj(batch<std::complex<T>, A> const& self, requires_arch<generic>) {
2222
return {self.real(), - self.imag()};
2323
}
2424

2525
// norm
26-
template<class A, class T> batch<T, A> norm(batch<std::complex<T>, A> const& self, requires<generic>) {
26+
template<class A, class T> batch<T, A> norm(batch<std::complex<T>, A> const& self, requires_arch<generic>) {
2727
return {fma(self.real(), self.real(), self.imag() * self.imag())};
2828
}
2929

3030

3131
// proj
32-
template<class A, class T> batch<std::complex<T>, A> proj(batch<std::complex<T>, A> const& self, requires<generic>) {
32+
template<class A, class T> batch<std::complex<T>, A> proj(batch<std::complex<T>, A> const& self, requires_arch<generic>) {
3333
using batch_type = batch<std::complex<T>, A>;
3434
using real_batch = typename batch_type::real_batch;
3535
auto cond = xsimd::isinf(self.real()) || xsimd::isinf(self.imag());

include-refactoring/xsimd/arch/generic/xsimd_generic_logical.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,70 +11,70 @@ namespace xsimd {
1111
using namespace types;
1212

1313
// ge
14-
template<class A, class T> batch_bool<T, A> ge(batch<T, A> const& self, batch<T, A> const& other, requires<generic>) {
14+
template<class A, class T> batch_bool<T, A> ge(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) {
1515
return other <= self;
1616
}
1717

1818
// gt
19-
template<class A, class T> batch_bool<T, A> gt(batch<T, A> const& self, batch<T, A> const& other, requires<generic>) {
19+
template<class A, class T> batch_bool<T, A> gt(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) {
2020
return other < self;
2121
}
2222

2323
// is_even
24-
template<class A, class T> batch_bool<T, A> is_even(batch<T, A> const& self, requires<generic>) {
24+
template<class A, class T> batch_bool<T, A> is_even(batch<T, A> const& self, requires_arch<generic>) {
2525
return is_flint(self * T(0.5));
2626
}
2727

2828
// is_flint
29-
template<class A, class T> batch_bool<T, A> is_flint(batch<T, A> const& self, requires<generic>) {
29+
template<class A, class T> batch_bool<T, A> is_flint(batch<T, A> const& self, requires_arch<generic>) {
3030
auto frac = select(isnan(self - self), constants::nan<batch<T, A>>(), self - trunc(self));
3131
return frac == T(0.);
3232
}
3333

3434
// is_odd
35-
template<class A, class T> batch_bool<T, A> is_odd(batch<T, A> const& self, requires<generic>) {
35+
template<class A, class T> batch_bool<T, A> is_odd(batch<T, A> const& self, requires_arch<generic>) {
3636
return is_even(self - T(1.));
3737
}
3838

3939
// isinf
4040
template<class A, class T, class=typename std::enable_if<std::is_integral<T>::value, void>::type>
41-
batch_bool<T, A> isinf(batch<T, A> const& , requires<generic>) {
41+
batch_bool<T, A> isinf(batch<T, A> const& , requires_arch<generic>) {
4242
return batch_bool<T, A>(false);
4343
}
44-
template<class A> batch_bool<float, A> isinf(batch<float, A> const& self, requires<generic>) {
44+
template<class A> batch_bool<float, A> isinf(batch<float, A> const& self, requires_arch<generic>) {
4545
return abs(self) == std::numeric_limits<float>::infinity();
4646
}
47-
template<class A> batch_bool<double, A> isinf(batch<double, A> const& self, requires<generic>) {
47+
template<class A> batch_bool<double, A> isinf(batch<double, A> const& self, requires_arch<generic>) {
4848
return abs(self) == std::numeric_limits<double>::infinity();
4949
}
5050

5151
// isfinite
5252
template<class A, class T, class=typename std::enable_if<std::is_integral<T>::value, void>::type>
53-
batch_bool<T, A> isfinite(batch<T, A> const& , requires<generic>) {
53+
batch_bool<T, A> isfinite(batch<T, A> const& , requires_arch<generic>) {
5454
return batch_bool<T, A>(true);
5555
}
56-
template<class A> batch_bool<float, A> isfinite(batch<float, A> const& self, requires<generic>) {
56+
template<class A> batch_bool<float, A> isfinite(batch<float, A> const& self, requires_arch<generic>) {
5757
return (self - self) == 0;
5858
}
59-
template<class A> batch_bool<double, A> isfinite(batch<double, A> const& self, requires<generic>) {
59+
template<class A> batch_bool<double, A> isfinite(batch<double, A> const& self, requires_arch<generic>) {
6060
return (self - self) == 0;
6161
}
6262

6363
// isnan
6464
template<class A, class T, class=typename std::enable_if<std::is_integral<T>::value, void>::type>
65-
batch_bool<T, A> isnan(batch<T, A> const& , requires<generic>) {
65+
batch_bool<T, A> isnan(batch<T, A> const& , requires_arch<generic>) {
6666
return batch_bool<T, A>(false);
6767
}
6868

6969
// le
7070
template<class A, class T, class=typename std::enable_if<std::is_integral<T>::value, void>::type>
71-
batch_bool<T, A> le(batch<T, A> const& self, batch<T, A> const& other, requires<generic>) {
71+
batch_bool<T, A> le(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) {
7272
return (self < other) || (self == other);
7373
}
7474

7575

7676
// neq
77-
template<class A, class T> batch_bool<T, A> neq(batch<T, A> const& self, batch<T, A> const& other, requires<generic>) {
77+
template<class A, class T> batch_bool<T, A> neq(batch<T, A> const& self, batch<T, A> const& other, requires_arch<generic>) {
7878
return !(other == self);
7979
}
8080
}

0 commit comments

Comments
 (0)