mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +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:
@@ -14,6 +14,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
#include "harness/errorHelpers.h"
|
||||
#include "harness/mathHelpers.h"
|
||||
#include "harness/testHarness.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cinttypes>
|
||||
@@ -834,9 +836,9 @@ size_t check_half(const void *const test, const void *const correct,
|
||||
// Allow nans to be binary different
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
float fcorrect = cl_half_to_float(c[i]);
|
||||
float ftest = cl_half_to_float(t[i]);
|
||||
if ((t[i] != c[i]) && !(isnan(fcorrect) && isnan(ftest)))
|
||||
if ((t[i] != c[i])
|
||||
&& !(isnan_fp(cl_half_to_float(c[i]))
|
||||
&& isnan_fp(cl_half_to_float(t[i]))))
|
||||
{
|
||||
log_error("\n(check_half) Error for vector size %zu found at "
|
||||
"0x%8.8zx (of 0x%8.8zx): "
|
||||
|
||||
Reference in New Issue
Block a user