Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address CI failures #2

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Changes from all commits
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
36 changes: 29 additions & 7 deletions common/unit_test/Test_Common_ArithTraits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,20 @@ class ArithTraitsTesterBase {
}

if (AT::has_infinity) {
if (!AT::isInf(AT::infinity())) {
out << "AT::isInf (inf) != true" << endl;
FAILURE();
// Compiler intrinsic casts from inf of type half_t / bhalf_t to inf
// of type float in CUDA, SYCL and HIP do not work yet.
#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_SYCL) || \
defined(KOKKOS_ENABLE_HIP)
namespace KE = Kokkos::Experimental;
if constexpr (!std::is_same<ScalarType, KE::half_t>::value &&
!std::is_same<ScalarType, KE::bhalf_t>::value) {
#else
{
#endif // KOKKOS_ENABLE_CUDA || KOKKOS_ENABLE_SYCL || KOKKOS_ENABLE_HIP
if (!AT::isInf(AT::infinity())) {
out << "AT::isInf (inf) != true" << endl;
FAILURE();
}
}
}
if (!std::is_same<ScalarType, decltype(AT::infinity())>::value) {
Expand Down Expand Up @@ -1495,13 +1506,24 @@ class ArithTraitsTesterFloatingPointBase<ScalarType, DeviceType, 0>
FAILURE();
}

if (!AT::isNan(AT::nan())) {
// Compiler intrinsic casts from nan of type half_t / bhalf_t to nan
// of type float in CUDA, SYCL and HIP do not work yet.
#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_SYCL) || \
defined(KOKKOS_ENABLE_HIP)
namespace KE = Kokkos::Experimental;
if constexpr (!std::is_same<ScalarType, KE::half_t>::value &&
!std::is_same<ScalarType, KE::bhalf_t>::value) {
#else
{
#endif // KOKKOS_ENABLE_CUDA || KOKKOS_ENABLE_SYCL || KOKKOS_ENABLE_HIP
if (!AT::isNan(AT::nan())) {
#if KOKKOS_VERSION < 40199
KOKKOS_IMPL_DO_NOT_USE_PRINTF("NaN is not NaN\n");
KOKKOS_IMPL_DO_NOT_USE_PRINTF("NaN is not NaN\n");
Copy link
Owner

Choose a reason for hiding this comment

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

This is not running on device as far as I can tell so why not use std::cout instead of the device Kokkos::printf()?

#else
Kokkos::printf("NaN is not NaN\n");
Kokkos::printf("NaN is not NaN\n");
#endif
FAILURE();
FAILURE();
}
}

const ScalarType zero = AT::zero();
Expand Down