From ede96b9f5a425abaad6c9e8cdd0923bc12eeefb5 Mon Sep 17 00:00:00 2001 From: David Bayer <48736217+davebayer@users.noreply.github.com> Date: Tue, 23 Jun 2026 11:29:05 +0200 Subject: [PATCH] [libcu++] Skip `__fp_set_exp` `fpclassify` tests on denormals (#9536) (cherry picked from commit 18d62e424bbe78173d1f442f1bd5df09d6f98092) --- .../numerics/floating.point/decompose/set_exp.pass.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libcudacxx/test/libcudacxx/libcxx/numerics/floating.point/decompose/set_exp.pass.cpp b/libcudacxx/test/libcudacxx/libcxx/numerics/floating.point/decompose/set_exp.pass.cpp index 7e8ff1c6ba4..edc3f2a4925 100644 --- a/libcudacxx/test/libcudacxx/libcxx/numerics/floating.point/decompose/set_exp.pass.cpp +++ b/libcudacxx/test/libcudacxx/libcxx/numerics/floating.point/decompose/set_exp.pass.cpp @@ -65,7 +65,11 @@ TEST_FUNC _CCCL_CONSTEXPR_BIT_CAST void test_fp_set_exp(T val) assert(!cuda::std::isnan(res)); assert(!cuda::std::isinf(res)); assert(cuda::std::isfinite(res)); + // NVHPC flushes subnormals to 0 by default on some architectures. That causes this check to fail, because we use + // __builtin_fpclassify to implement fpclassify. Re-enable once nvbug 6303102 is resolved. +#if !TEST_COMPILER(NVHPC) assert(cuda::std::fpclassify(res) == FP_SUBNORMAL); +#endif // !TEST_COMPILER(NVHPC) } if constexpr (cuda::std::__fp_has_denorm_v && cuda::std::__fp_is_signed_v) @@ -75,7 +79,11 @@ TEST_FUNC _CCCL_CONSTEXPR_BIT_CAST void test_fp_set_exp(T val) assert(!cuda::std::isnan(res)); assert(!cuda::std::isinf(res)); assert(cuda::std::isfinite(res)); + // NVHPC flushes subnormals to 0 by default on some architectures. That causes this check to fail, because we use + // __builtin_fpclassify to implement fpclassify. Re-enable once nvbug 6303102 is resolved. +#if !TEST_COMPILER(NVHPC) assert(cuda::std::fpclassify(res) == FP_SUBNORMAL); +#endif // !TEST_COMPILER(NVHPC) } }