mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-24 15:59:03 +00:00
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:
@@ -19,6 +19,7 @@
|
||||
#include "harness/compat.h"
|
||||
#include "harness/rounding_mode.h"
|
||||
#include "harness/fpcontrol.h"
|
||||
#include "harness/mathHelpers.h"
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/ThreadPool.h"
|
||||
#include "harness/conversions.h"
|
||||
@@ -172,16 +173,6 @@ inline int IsFloatNaN(double x)
|
||||
return ((u.u & 0x7fffffffU) > 0x7F800000U);
|
||||
}
|
||||
|
||||
inline bool IsHalfNaN(const cl_half v)
|
||||
{
|
||||
// Extract FP16 exponent and mantissa
|
||||
uint16_t h_exp = (((cl_half)v) >> (CL_HALF_MANT_DIG - 1)) & 0x1F;
|
||||
uint16_t h_mant = ((cl_half)v) & 0x3FF;
|
||||
|
||||
// NaN test
|
||||
return (h_exp == 0x1F && h_mant != 0);
|
||||
}
|
||||
|
||||
inline bool IsHalfInfinity(const cl_half v)
|
||||
{
|
||||
// Extract FP16 exponent and mantissa
|
||||
|
||||
Reference in New Issue
Block a user