Merge "Touch process watchdog in built-in precision tests" into marshmallow-cts-dev...
authorDaniel Xie <dxie@google.com>
Tue, 23 Feb 2016 23:02:44 +0000 (23:02 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Tue, 23 Feb 2016 23:02:44 +0000 (23:02 +0000)
am: 88cd3abfe7

* commit '88cd3abfe7db05a823a1fe6a427fc566656eb049':
  Touch process watchdog in built-in precision tests

modules/glshared/glsBuiltinPrecisionTests.cpp

index 1a00ed3..fdb5295 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]));