[NFC] math_brute_force: use getAllowedUlpError for half (#2086)

Call `getAllowedUlpError` to obtain the allowed ULP error for all of the
half type (fp16) tests. The aim is to standardise obtaining the desired
ULP requirement and pave the way for adding the Embedded Profile ULP
errors.

Contributes to https://github.com/KhronosGroup/OpenCL-CTS/issues/867
Contributes to https://github.com/KhronosGroup/OpenCL-CTS/issues/1685

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2024-10-29 17:37:51 +01:00
committed by GitHub
parent bc5f6cdfe8
commit dd2454685b
9 changed files with 9 additions and 9 deletions

View File

@@ -653,7 +653,7 @@ int TestFunc_Half_Half_Half_common(const Func *f, MTdata d, int isNextafter,
}
test_info.f = f;
test_info.ulps = f->half_ulps;
test_info.ulps = getAllowedUlpError(f, khalf, relaxedMode);
test_info.ftz =
f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gHalfCapabilities);

View File

@@ -427,7 +427,7 @@ int TestFunc_Half_Half_Int(const Func *f, MTdata d, bool relaxedMode)
}
test_info.f = f;
test_info.ulps = f->half_ulps;
test_info.ulps = getAllowedUlpError(f, khalf, relaxedMode);
test_info.ftz =
f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gHalfCapabilities);

View File

@@ -564,7 +564,7 @@ int TestFunc_Half_Half_Half_Operator(const Func *f, MTdata d, bool relaxedMode)
}
test_info.f = f;
test_info.ulps = f->half_ulps;
test_info.ulps = getAllowedUlpError(f, khalf, relaxedMode);
test_info.ftz =
f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gHalfCapabilities);

View File

@@ -91,7 +91,7 @@ int TestFunc_HalfI_Half_Half(const Func *f, MTdata d, bool relaxedMode)
cl_uint threadCount = GetThreadCount();
float half_ulps = f->half_ulps;
float half_ulps = getAllowedUlpError(f, khalf, relaxedMode);
int testingRemquo = !strcmp(f->name, "remquo");

View File

@@ -80,7 +80,7 @@ int TestFunc_Half_Half_Half_Half(const Func *f, MTdata d, bool relaxedMode)
constexpr size_t bufferElements = BUFFER_SIZE / sizeof(cl_half);
std::vector<cl_uchar> overflow(bufferElements);
float half_ulps = f->half_ulps;
float half_ulps = getAllowedUlpError(f, khalf, relaxedMode);
int skipNanInf = (0 == strcmp("fma", f->nameInCode));
logFunctionInfo(f->name, sizeof(cl_half), relaxedMode);

View File

@@ -362,7 +362,7 @@ int TestFunc_Half_Half(const Func *f, MTdata d, bool relaxedMode)
}
test_info.f = f;
test_info.ulps = f->half_ulps;
test_info.ulps = getAllowedUlpError(f, khalf, relaxedMode);
test_info.ftz =
f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gHalfCapabilities);

View File

@@ -61,7 +61,7 @@ int TestFunc_Half2_Half(const Func *f, MTdata d, bool relaxedMode)
logFunctionInfo(f->name, sizeof(cl_half), relaxedMode);
float half_ulps = f->half_ulps;
float half_ulps = getAllowedUlpError(f, khalf, relaxedMode);
// Init the kernels
BuildKernelInfo build_info{ 1, kernels, programs, f->nameInCode };

View File

@@ -71,7 +71,7 @@ int TestFunc_HalfI_Half(const Func *f, MTdata d, bool relaxedMode)
logFunctionInfo(f->name, sizeof(cl_half), relaxedMode);
float half_ulps = f->half_ulps;
float half_ulps = getAllowedUlpError(f, khalf, relaxedMode);
maxiError = half_ulps == INFINITY ? CL_ULONG_MAX : 0;

View File

@@ -54,7 +54,7 @@ int TestFunc_Half_UShort(const Func *f, MTdata d, bool relaxedMode)
size_t bufferSize = bufferElements * sizeof(cl_half);
logFunctionInfo(f->name, sizeof(cl_half), relaxedMode);
const char *name = f->name;
float half_ulps = f->half_ulps;
float half_ulps = getAllowedUlpError(f, khalf, relaxedMode);
// Init the kernels
BuildKernelInfo build_info = { 1, kernels, programs, f->nameInCode };