Skip to content

Commit 6ea1120

Browse files
committed
Replace remaining std namespace transcendental functions
A few stray instances of `signbit`, `atan`, `log`, and `exp` as well as `atan2` and `hypot`
1 parent 0650dc8 commit 6ea1120

File tree

17 files changed

+30
-30
lines changed

17 files changed

+30
-30
lines changed

dpctl/tensor/libtensor/include/kernels/elementwise_functions/acos.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ template <typename fnT, typename T> struct AcosContigFactory
188188

189189
template <typename fnT, typename T> struct AcosTypeMapFactory
190190
{
191-
/*! @brief get typeid for output type of std::acos(T x) */
191+
/*! @brief get typeid for output type of sycl::acos(T x) */
192192
std::enable_if_t<std::is_same<fnT, int>::value, int> get()
193193
{
194194
using rT = typename AcosOutputType<T>::value_type;

dpctl/tensor/libtensor/include/kernels/elementwise_functions/acosh.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ template <typename fnT, typename T> struct AcoshContigFactory
215215

216216
template <typename fnT, typename T> struct AcoshTypeMapFactory
217217
{
218-
/*! @brief get typeid for output type of std::acosh(T x) */
218+
/*! @brief get typeid for output type of sycl::acosh(T x) */
219219
std::enable_if_t<std::is_same<fnT, int>::value, int> get()
220220
{
221221
using rT = typename AcoshOutputType<T>::value_type;

dpctl/tensor/libtensor/include/kernels/elementwise_functions/asin.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ template <typename argT, typename resT> struct AsinFunctor
136136
}
137137
/* ordinary cases */
138138
return exprm_ns::asin(
139-
exprm_ns::complex<realT>(in)); // std::asin(in);
139+
exprm_ns::complex<realT>(in)); // sycl::asin(in);
140140
}
141141
else {
142142
static_assert(std::is_floating_point_v<argT> ||
@@ -208,7 +208,7 @@ template <typename fnT, typename T> struct AsinContigFactory
208208

209209
template <typename fnT, typename T> struct AsinTypeMapFactory
210210
{
211-
/*! @brief get typeid for output type of std::asin(T x) */
211+
/*! @brief get typeid for output type of sycl::asin(T x) */
212212
std::enable_if_t<std::is_same<fnT, int>::value, int> get()
213213
{
214214
using rT = typename AsinOutputType<T>::value_type;

dpctl/tensor/libtensor/include/kernels/elementwise_functions/asinh.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ template <typename fnT, typename T> struct AsinhContigFactory
191191

192192
template <typename fnT, typename T> struct AsinhTypeMapFactory
193193
{
194-
/*! @brief get typeid for output type of std::asinh(T x) */
194+
/*! @brief get typeid for output type of sycl::asinh(T x) */
195195
std::enable_if_t<std::is_same<fnT, int>::value, int> get()
196196
{
197197
using rT = typename AsinhOutputType<T>::value_type;

dpctl/tensor/libtensor/include/kernels/elementwise_functions/atan.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ template <typename fnT, typename T> struct AtanContigFactory
198198

199199
template <typename fnT, typename T> struct AtanTypeMapFactory
200200
{
201-
/*! @brief get typeid for output type of std::atan(T x) */
201+
/*! @brief get typeid for output type of sycl::atan(T x) */
202202
std::enable_if_t<std::is_same<fnT, int>::value, int> get()
203203
{
204204
using rT = typename AtanOutputType<T>::value_type;

dpctl/tensor/libtensor/include/kernels/elementwise_functions/atan2.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ template <typename argT1, typename argT2, typename resT> struct Atan2Functor
5656

5757
resT operator()(const argT1 &in1, const argT2 &in2) const
5858
{
59-
if (std::isinf(in2) && !std::signbit(in2)) {
59+
if (std::isinf(in2) && !sycl::signbit(in2)) {
6060
if (std::isfinite(in1)) {
6161
return sycl::copysign(resT(0), in1);
6262
}
6363
}
64-
return std::atan2(in1, in2);
64+
return sycl::atan2(in1, in2);
6565
}
6666
};
6767

@@ -145,7 +145,7 @@ template <typename fnT, typename T1, typename T2> struct Atan2ContigFactory
145145

146146
template <typename fnT, typename T1, typename T2> struct Atan2TypeMapFactory
147147
{
148-
/*! @brief get typeid for output type of std::hypot(T1 x, T2 y) */
148+
/*! @brief get typeid for output type of sycl::atan2(T1 x, T2 y) */
149149
std::enable_if_t<std::is_same<fnT, int>::value, int> get()
150150
{
151151
using rT = typename Atan2OutputType<T1, T2>::value_type;

dpctl/tensor/libtensor/include/kernels/elementwise_functions/atanh.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ template <typename argT, typename resT> struct AtanhFunctor
7676
if (std::isnan(x)) {
7777
/* atanh(NaN + I*+-Inf) = sign(NaN)0 + I*+-PI/2 */
7878
if (std::isinf(y)) {
79-
const realT pi_half = std::atan(realT(1)) * 2;
79+
const realT pi_half = sycl::atan(realT(1)) * 2;
8080

8181
const realT res_re = sycl::copysign(realT(0), x);
8282
const realT res_im = sycl::copysign(pi_half, y);
@@ -113,7 +113,7 @@ template <typename argT, typename resT> struct AtanhFunctor
113113
realT(1) / std::numeric_limits<realT>::epsilon();
114114
if (sycl::fabs(x) > RECIP_EPSILON || sycl::fabs(y) > RECIP_EPSILON)
115115
{
116-
const realT pi_half = std::atan(realT(1)) * 2;
116+
const realT pi_half = sycl::atan(realT(1)) * 2;
117117

118118
const realT res_re = realT(0);
119119
const realT res_im = sycl::copysign(pi_half, y);
@@ -192,7 +192,7 @@ template <typename fnT, typename T> struct AtanhContigFactory
192192

193193
template <typename fnT, typename T> struct AtanhTypeMapFactory
194194
{
195-
/*! @brief get typeid for output type of std::atanh(T x) */
195+
/*! @brief get typeid for output type of sycl::atanh(T x) */
196196
std::enable_if_t<std::is_same<fnT, int>::value, int> get()
197197
{
198198
using rT = typename AtanhOutputType<T>::value_type;

dpctl/tensor/libtensor/include/kernels/elementwise_functions/exp.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ template <typename argT, typename resT> struct ExpFunctor
9090
}
9191
}
9292
else {
93-
if (!std::signbit(x)) { /* x is +inf */
93+
if (!sycl::signbit(x)) { /* x is +inf */
9494
if (y == realT(0)) {
9595
return resT{x, y};
9696
}

dpctl/tensor/libtensor/include/kernels/elementwise_functions/exp2.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ template <typename argT, typename resT> struct Exp2Functor
6868
if constexpr (is_complex<argT>::value) {
6969
using realT = typename argT::value_type;
7070

71-
const argT tmp = in * std::log(realT(2));
71+
const argT tmp = in * sycl::log(realT(2));
7272

7373
constexpr realT q_nan = std::numeric_limits<realT>::quiet_NaN();
7474

@@ -92,7 +92,7 @@ template <typename argT, typename resT> struct Exp2Functor
9292
}
9393
}
9494
else {
95-
if (!std::signbit(x)) { /* x is +inf */
95+
if (!sycl::signbit(x)) { /* x is +inf */
9696
if (y == realT(0)) {
9797
return resT{x, y};
9898
}

dpctl/tensor/libtensor/include/kernels/elementwise_functions/hypot.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ template <typename argT1, typename argT2, typename resT> struct HypotFunctor
5858

5959
resT operator()(const argT1 &in1, const argT2 &in2) const
6060
{
61-
return std::hypot(in1, in2);
61+
return sycl::hypot(in1, in2);
6262
}
6363

6464
template <int vec_sz>
@@ -160,7 +160,7 @@ template <typename fnT, typename T1, typename T2> struct HypotContigFactory
160160

161161
template <typename fnT, typename T1, typename T2> struct HypotTypeMapFactory
162162
{
163-
/*! @brief get typeid for output type of std::hypot(T1 x, T2 y) */
163+
/*! @brief get typeid for output type of sycl::hypot(T1 x, T2 y) */
164164
std::enable_if_t<std::is_same<fnT, int>::value, int> get()
165165
{
166166
using rT = typename HypotOutputType<T1, T2>::value_type;

0 commit comments

Comments
 (0)