Fix 'fpclassify: ambiguous call' compile fail in MSVC 2022 (#2426)

Similar to #2219, we see "'fpclassify': ambiguous call" error in
test_conformance\basic\test_fpmath.cpp
due to missing constexpr at
https://github.com/KhronosGroup/OpenCL-CTS/blob/9265cbb2c274/test_conformance/basic/test_fpmath.cpp#L104
This PR fixes the issue by moving utility function isnan_fp in
testHarness.h and use it.
Note this PR doesn't modify use of isnan in many tests where only
float/double values are checked.
This commit is contained in:
Wenju He
2025-08-06 00:08:04 +08:00
committed by GitHub
parent 9ca0126c54
commit e15c6eb760
12 changed files with 94 additions and 107 deletions

View File

@@ -20,6 +20,7 @@
#define _testBase_h
#include "harness/compat.h"
#include "harness/mathHelpers.h"
#include "harness/rounding_mode.h"
#include <stdio.h>

View File

@@ -231,7 +231,7 @@ static inline
f = cl_half_to_float(cl_half_from_float(f, half_rounding));
To val = static_cast<To>(std::min<float>(std::max<float>(f, loVal), hiVal));
if (isnan(cl_half_to_float(rhs)))
if (isnan_fp(rhs))
{
val = 0;
}