Skip to content

Commit

Permalink
conversions: fix condition for adding -cl-denorms-are-zero
Browse files Browse the repository at this point in the history
Commit b6941b6 ("Add fp16 testing to conversions and bruteforce
(#1975)", 2024-06-18) introduced a behavioural change for non-half
tests.  The `-cl-denorms-are-zero` option could be added for non-half
tests such as `char_rtn_float` even when `gForceFTZ` was `false`.  Fix
the condition by also taking the input and output types into account.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
  • Loading branch information
svenvh committed Sep 3, 2024
1 parent 90f523e commit 6026204
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test_conformance/conversions/basic_test_conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,11 @@ cl_program MakeProgram(Type outType, Type inType, SaturationMode sat,
*outKernel = NULL;

const char *flags = NULL;
if (gForceFTZ || gForceHalfFTZ) flags = "-cl-denorms-are-zero";
if ((gForceFTZ && (inType == kfloat || outType == kfloat))
|| (gForceHalfFTZ && (inType == khalf || outType == khalf)))
{
flags = "-cl-denorms-are-zero";
}

// build it
std::string sourceString = source.str();
Expand Down

0 comments on commit 6026204

Please sign in to comment.