From 82dffae022b051394741e71d57f63cc170075bd3 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 16 Oct 2017 12:42:35 -0700 Subject: [PATCH] Avoid watchdog timeout in Vulkan builtin precision tests Calculating the reference intervals can take a substantial amount of time. On some very slow targets, this can cause us to trip the watchdog in the verification loop. Same approach and limit as in modules/glshared/glsBuiltinPrecisionTests.cpp Affected tests: dEQP-VK.glsl.builtin.precision.* Component: Vulkan Bug: 67854695 Test: run on google devices Change-Id: I492b656e7e2a9aa724bb3785bdf1416a4c22ec04 --- .../vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp b/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp index 4e406d8..a5c09c7 100644 --- a/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp +++ b/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp @@ -63,6 +63,15 @@ // set this to true to dump even passing results #define GLS_LOG_ALL_RESULTS false +enum +{ + // Computing reference intervals can take a non-trivial amount of time, especially on + // platforms where toggling floating-point rounding mode is slow (emulated arm on x86). + // As a workaround watchdog is kept happy by touching it periodically during reference + // interval computation. + TOUCH_WATCHDOG_VALUE_FREQUENCY = 4096 +}; + namespace vkt { namespace shaderexecutor @@ -4489,6 +4498,9 @@ tcu::TestStatus BuiltinPrecisionCaseTestInstance::iterate (void) typename Traits::IVal reference0; typename Traits::IVal reference1; + if (valueNdx % (size_t)TOUCH_WATCHDOG_VALUE_FREQUENCY == 0) + m_context.getTestContext().touchWatchdog(); + env.lookup(*m_variables.in0) = convert(fmt, round(fmt, inputs.in0[valueNdx])); env.lookup(*m_variables.in1) = convert(fmt, round(fmt, inputs.in1[valueNdx])); env.lookup(*m_variables.in2) = convert(fmt, round(fmt, inputs.in2[valueNdx])); -- 2.7.4