summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Performance/CodeQuality/BenchF
diff options
context:
space:
mode:
authorNatalia Glagoleva <natgla@microsoft.com>2016-03-31 12:14:44 -0700
committerNatalia Glagoleva <natgla@microsoft.com>2016-03-31 12:14:44 -0700
commit347f1646757bf149c1da5e25f0e53ed2fb70c47c (patch)
tree72e2f91d01d71196fbc4072842e0c616d7bf93b7 /tests/src/JIT/Performance/CodeQuality/BenchF
parentf32f0b30a2fc05cb63b2e2ab8873db37a5c6c75c (diff)
downloadcoreclr-347f1646757bf149c1da5e25f0e53ed2fb70c47c.tar.gz
coreclr-347f1646757bf149c1da5e25f0e53ed2fb70c47c.tar.bz2
coreclr-347f1646757bf149c1da5e25f0e53ed2fb70c47c.zip
Moving validation out of measured code
Diffstat (limited to 'tests/src/JIT/Performance/CodeQuality/BenchF')
-rw-r--r--tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs29
1 files changed, 14 insertions, 15 deletions
diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs b/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs
index eeb98a6cf2..427ec9269e 100644
--- a/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs
+++ b/tests/src/JIT/Performance/CodeQuality/BenchF/Adams/Adams.cs
@@ -101,25 +101,12 @@ public static class Adams
}
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
- private static bool TestBench()
+ private static void TestBench()
{
for (int l = 1; l <= Iterations; l++)
{
Bench();
}
-
- bool result = true;
- // Note: we can't check xn or yn better because of the precision
- // with which original results are given
- result &= System.Math.Abs(g_xn_base - g_xn) <= 1.5e-7;
- result &= System.Math.Abs(g_yn_base - g_yn) <= 1.5e-7;
- result &= System.Math.Abs(g_dn) <= 2.5e-9;
- // Actual error is much bigger than base error;
- // this is likely due to the fact that the original program was written in Fortran
- // and was running on a mainframe with a non-IEEE floating point arithmetic
- // (it's still beyond the published precision of yn)
- result &= System.Math.Abs(g_en) <= 5.5e-8;
- return result;
}
#if XUNIT_PERF
@@ -136,6 +123,7 @@ public static class Adams
}
#endif // XUNIT_PERF
+ [MethodImpl(MethodImplOptions.NoOptimization)]
public static int Main(string[] argv)
{
if (argv.Length > 0)
@@ -144,9 +132,20 @@ public static class Adams
}
Stopwatch sw = Stopwatch.StartNew();
- bool result = TestBench();
+ TestBench();
sw.Stop();
+ bool result = true;
+ // Note: we can't check xn or yn better because of the precision
+ // with which original results are given
+ result &= System.Math.Abs(g_xn_base - g_xn) <= 1.5e-7;
+ result &= System.Math.Abs(g_yn_base - g_yn) <= 1.5e-7;
+ result &= System.Math.Abs(g_dn) <= 2.5e-9;
+ // Actual error is much bigger than base error;
+ // this is likely due to the fact that the original program was written in Fortran
+ // and was running on a mainframe with a non-IEEE floating point arithmetic
+ // (it's still beyond the published precision of yn)
+ result &= System.Math.Abs(g_en) <= 5.5e-8;
Console.WriteLine(result ? "Passed" : "Failed");
Console.WriteLine(" BASE.....P1 1/4 (ADAMS-MOULTON), XN = {0}", g_xn_base);