Avoid watchdog timeout in Vulkan builtin precision tests
authorChris Forbes <chrisforbes@google.com>
Mon, 16 Oct 2017 19:42:35 +0000 (12:42 -0700)
committerChris Forbes <chrisforbes@google.com>
Fri, 20 Oct 2017 00:51:33 +0000 (17:51 -0700)
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

external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp

index 4e406d8..a5c09c7 100644 (file)
 // 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<In, Out>::iterate (void)
                typename Traits<Out0>::IVal     reference0;
                typename Traits<Out1>::IVal     reference1;
 
+               if (valueNdx % (size_t)TOUCH_WATCHDOG_VALUE_FREQUENCY == 0)
+                       m_context.getTestContext().touchWatchdog();
+
                env.lookup(*m_variables.in0) = convert<In0>(fmt, round(fmt, inputs.in0[valueNdx]));
                env.lookup(*m_variables.in1) = convert<In1>(fmt, round(fmt, inputs.in1[valueNdx]));
                env.lookup(*m_variables.in2) = convert<In2>(fmt, round(fmt, inputs.in2[valueNdx]));