Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions common/src/Kokkos_ArithTraits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1093,14 +1093,12 @@ class ArithTraits<std::complex<RealFloatType>> {
} else {
KOKKOS_IF_ON_HOST((using std::isinf;))
KOKKOS_IF_ON_DEVICE((using sycl::isinf;))
return isinf(real(x)) || isinf(imag(x));
return isinf(std::real(x)) || isinf(std::imag(x));
}
}
#else
static bool isInf(const std::complex<RealFloatType>& x) {
KOKKOS_IF_ON_HOST((using std::isinf;))
KOKKOS_IF_ON_DEVICE((using Kokkos::isinf;))
return isinf(real(x)) || isinf(imag(x));
return std::isinf(std::real(x)) || std::isinf(std::imag(x));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why std::?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I am not sure I understand how the hole thing works on device but if you look further down, real and imag function are implemented by call std::real and std::imag.
So for now it's not worse than it was and it allows to complete the scope I defined for this PR.
Of course these functions could easily cause problem down the line and opening an issue to work on it is appropriate.

}
#endif

Expand All @@ -1113,14 +1111,12 @@ class ArithTraits<std::complex<RealFloatType>> {
} else {
KOKKOS_IF_ON_HOST((using std::isnan;))
KOKKOS_IF_ON_DEVICE((using sycl::isnan;))
return isnan(real(x)) || isnan(imag(x));
return isnan(std::real(x)) || isnan(std::imag(x));
}
}
#else
static bool isNan(const std::complex<RealFloatType>& x) {
KOKKOS_IF_ON_HOST((using std::isnan;))
KOKKOS_IF_ON_DEVICE((using Kokkos::isnan;))
return isnan(real(x)) || isnan(imag(x));
return std::isnan(std::real(x)) || std::isnan(std::imag(x));
}
#endif
static mag_type abs(const std::complex<RealFloatType>& x) { return std::abs(x); }
Expand Down
Loading