Touch process watchdog in built-in precision tests
authorPyry Haulos <phaulos@google.com>
Wed, 3 Feb 2016 21:08:23 +0000 (13:08 -0800)
committerPyry Haulos <phaulos@google.com>
Wed, 3 Feb 2016 21:10:10 +0000 (13:10 -0800)
Computing reference intervals in built-in precision tests can take a
long time, especially on platforms where toggling floating-point
rounding mode is costly. Workaround is to periodically touch test
process watchdog to give more time for the computation to complete.

Bug: 26629688

Change-Id: I529bc77e638fc75cd0c152bb761775ad260772be

modules/glshared/glsBuiltinPrecisionTests.cpp

index bc7eb5d..81a3bc6 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 deqp
 {
 namespace gls
@@ -4553,6 +4562,9 @@ void PrecisionCase::testStatement (const Variables<In, Out>&      variables,
                typename Traits<Out0>::IVal     reference0;
                typename Traits<Out1>::IVal     reference1;
 
+               if (valueNdx % (size_t)TOUCH_WATCHDOG_VALUE_FREQUENCY == 0)
+                       m_testCtx.touchWatchdog();
+
                env.lookup(*variables.in0) = convert<In0>(fmt, round(fmt, inputs.in0[valueNdx]));
                env.lookup(*variables.in1) = convert<In1>(fmt, round(fmt, inputs.in1[valueNdx]));
                env.lookup(*variables.in2) = convert<In2>(fmt, round(fmt, inputs.in2[valueNdx]));