Reduce SeekUnroll iter count
authorMichelle McDaniel <adiaaida@gmail.com>
Mon, 9 Jan 2017 21:07:35 +0000 (13:07 -0800)
committerMichelle McDaniel <adiaaida@gmail.com>
Tue, 10 Jan 2017 17:37:00 +0000 (09:37 -0800)
On non-hardware accelerated platforms, reduce the inner iteration count in
SeekUnroll. This test was timing out in x86 release builds because the
iteration count was too high.

Commit migrated from https://github.com/dotnet/coreclr/commit/2c866c58c2f70332359b9846d9d6e73157021d63

src/coreclr/tests/src/JIT/Performance/CodeQuality/SIMD/SeekUnroll/SeekUnroll.cs

index 34c0ab8..3253e25 100644 (file)
@@ -62,9 +62,9 @@ public static class SeekUnroll
     // Iteration counts for inner loop set to have each call take 1 or
     // 2 seconds or so in release, finish quickly in debug.
 #if DEBUG
-    const int InnerIterations = 1;
+    static int InnerIterations = 1;
 #else
-    const int InnerIterations = 1000000000;
+    static int InnerIterations = 1000000000;
 #endif
 
     // Function to meaure InnerLoop using the xunit-perf benchmark measurement facilities
@@ -143,6 +143,14 @@ public static class SeekUnroll
     public static int Main()
     {
         int failures = 0;
+
+        // On non-hardware accelerated platforms, the test times out because it runs for too long.
+        // In those cases, we decrease InnerIterations so the test doesn't time out.
+        if (!Vector.IsHardwareAccelerated)
+        {
+            InnerIterations = 100000;
+        }
+
         foreach(int index in IndicesToTest)
         {
             ManualLoopTimes = new long[10];