mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Fix math tests to allow ftz in relaxed mode. (#1371)
* Fix math tests to allow ftz in relaxed mode. In recent spec clarification, it is agreed that ftz is a valid optimization in case of cl-fast-math-relaxed and doesn't require cl-denorms-are-zero to be passed explicitly to enforce ftz behavior for implementations that already support this. GitHub Spec Issue OpenCL-Docs#579 GitHub Spec Issue OpenCL-Docs#597 GitHub CTS Issue OpenCL-CTS#1267
This commit is contained in:
@@ -461,7 +461,7 @@ cl_int Test(cl_uint job_id, cl_uint thread_id, void *data)
|
||||
{
|
||||
// Calculate the correctly rounded reference result
|
||||
memset(&oldMode, 0, sizeof(oldMode));
|
||||
if (ftz) ForceFTZ(&oldMode);
|
||||
if (ftz || relaxedMode) ForceFTZ(&oldMode);
|
||||
|
||||
// Set the rounding mode to match the device
|
||||
if (gIsInRTZMode) oldRoundMode = set_round(kRoundTowardZero, kfloat);
|
||||
@@ -546,7 +546,7 @@ cl_int Test(cl_uint job_id, cl_uint thread_id, void *data)
|
||||
float err = Ulp_Error(test, correct);
|
||||
int fail = !(fabsf(err) <= ulps);
|
||||
|
||||
if (fail && ftz)
|
||||
if (fail && (ftz || relaxedMode))
|
||||
{
|
||||
// retry per section 6.5.3.2
|
||||
if (IsFloatResultSubnormal(correct, ulps))
|
||||
|
||||
Reference in New Issue
Block a user