Commit 332fd466 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add extra consistency check.

parent 9584e97f
......@@ -90,6 +90,7 @@ main()
++(occCount[i][list[i]]);
}
failures = 0;
size_t occCountSum = 0;
for (size_t j = 0; j < n; ++j)
for (size_t i = 0; i < n; ++i)
{
......@@ -98,6 +99,7 @@ main()
float rel_delta = abs_delta / (float)n / (float)numRuns;
if (rel_delta > 0.01f)
++failures;
occCountSum += occCount[j][i];
}
if (failures > 0)
{
......@@ -111,6 +113,12 @@ main()
fputs("\n", stdout);
}
}
if (occCountSum != n * numRuns)
{
fprintf(stderr, "n*numRuns=%zu, occCountSum=%zu\n", n*numRuns, occCountSum);
exit(EXIT_FAILURE);
}
}
free(list);
free(occCount);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment