Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Reduce SeekUnroll iter count #8861

Merged
merged 1 commit into from
Jan 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ static void InnerLoop(ref int foundIndex, ref Vector<Byte> vector)
// 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
Expand Down Expand Up @@ -143,6 +143,14 @@ public static bool Test(object boxedIndex)
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)
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Might want to add a comment explaining this.
  2. Have you verified that this fixes the problem when run through the test harness? It just now occurred to me that maybe Main doesn't execute when xunit-perf runs the test? (also, I'm not sure if our CI is running this through xunit-perf or not... presumably if we do want to track the performance of this test on a non-accelerated platform we'd want some value between 1 and 100000000...)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment and upped the value to 100000. We can up it again later if we need/want to. I've tested this inside runtest.cmd, and it runs successfully.

InnerIterations = 100000;
}

foreach(int index in IndicesToTest)
{
ManualLoopTimes = new long[10];
Expand Down