mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-24 15:59:03 +00:00
math_brute_force: always initialize oldMode (#1796)
Avoid a maybe-uninitialized warning by ensuring that `oldMode` is always initialized to 0. There is no need to use `memset` for this, as `FPU_mode_type` is either an `int` or an `int64_t`. Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
committed by
GitHub
parent
aa23f345c3
commit
ddf46ca9e8
@@ -189,12 +189,11 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
// Get that moving
|
// Get that moving
|
||||||
if ((error = clFlush(gQueue))) vlog("clFlush failed\n");
|
if ((error = clFlush(gQueue))) vlog("clFlush failed\n");
|
||||||
|
|
||||||
FPU_mode_type oldMode;
|
FPU_mode_type oldMode = 0;
|
||||||
RoundingMode oldRoundMode = kRoundToNearestEven;
|
RoundingMode oldRoundMode = kRoundToNearestEven;
|
||||||
if (isFract)
|
if (isFract)
|
||||||
{
|
{
|
||||||
// Calculate the correctly rounded reference result
|
// Calculate the correctly rounded reference result
|
||||||
memset(&oldMode, 0, sizeof(oldMode));
|
|
||||||
if (ftz || relaxedMode) ForceFTZ(&oldMode);
|
if (ftz || relaxedMode) ForceFTZ(&oldMode);
|
||||||
|
|
||||||
// Set the rounding mode to match the device
|
// Set the rounding mode to match the device
|
||||||
|
|||||||
Reference in New Issue
Block a user