From e3c8de8eb621db4ad2b6616267cba2eb3b444bb0 Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Tue, 3 Oct 2023 18:36:01 +0200 Subject: [PATCH] math_brute_force: don't set/restore FTZ mode twice (#1808) The suite's `main()` function already disables the FTZ mode prior to invoking `runTestHarnessWithCheck` and restores the FP state afterwards, so tests don't have to do so themselves. Signed-off-by: Sven van Haastregt --- test_conformance/math_brute_force/i_unary_double.cpp | 6 ------ test_conformance/math_brute_force/i_unary_float.cpp | 6 ------ 2 files changed, 12 deletions(-) diff --git a/test_conformance/math_brute_force/i_unary_double.cpp b/test_conformance/math_brute_force/i_unary_double.cpp index 3d6ce152..953c33bb 100644 --- a/test_conformance/math_brute_force/i_unary_double.cpp +++ b/test_conformance/math_brute_force/i_unary_double.cpp @@ -50,11 +50,6 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); - // This test is not using ThreadPool so we need to disable FTZ here - // for reference computations - FPU_mode_type oldMode; - DisableFTZ(&oldMode); - Force64BitFPUPrecision(); // Init the kernels @@ -227,6 +222,5 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - RestoreFPState(&oldMode); return error; } diff --git a/test_conformance/math_brute_force/i_unary_float.cpp b/test_conformance/math_brute_force/i_unary_float.cpp index 94ebc66a..0ce37cc8 100644 --- a/test_conformance/math_brute_force/i_unary_float.cpp +++ b/test_conformance/math_brute_force/i_unary_float.cpp @@ -49,11 +49,6 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); - // This test is not using ThreadPool so we need to disable FTZ here - // for reference computations - FPU_mode_type oldMode; - DisableFTZ(&oldMode); - Force64BitFPUPrecision(); // Init the kernels @@ -225,6 +220,5 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - RestoreFPState(&oldMode); return error; }