+2015-07-14 Maxim Blumenthal <maxim.blumenthal@intel.com>
+
+ * testsuite/libgomp.c/examples-4/simd-3.c: (main): Change type of res
+ and ref from int to double. Replaced their comparison with
+ an inequality of their difference and EPS.
+ * testsuite/libgomp.c/examples-4/simd-8.c: (main): Replace the
+ comparison of pri and a reference number with an inequality of their
+ difference and EPS.
+ * testsuite/libgomp.fortran/examples-4/simd-3.f90: (main): Replaced
+ the comparison of sum and sum_ref with an inequality of their
+ difference and EPS.
+ * testsuite/libgomp.fortran/examples-4/simd-8.f90: (main): Replace
+ the comparison of pri and a reference number with an inequality of
+ their difference and EPS.
+
2015-07-13 Maxim Blumenthal <maxim.blumenthal@intel.com>
* testsuite/libgomp.c++/examples-4/e.53.2.C: Renamed to...
int main ()
{
- double a[N], a_ref[N], b[N];
- int res, ref;
+ double a[N], a_ref[N], b[N], res, ref, diff;
init(a, a_ref, b, N);
res = work(a, b, N);
ref = work_ref(a_ref, b, N);
- if (res != ref)
+ diff = res - ref;
+
+ if (diff > EPS || -diff > EPS)
abort ();
return 0;
#include <stdlib.h>
#include <math.h>
+#define EPS 0.005
+
int P[1000];
float A[1000];
int main(void)
{
- float pri, arr[1000];
+ float pri, arr[1000], diff;
for (int i = 0; i < 1000; ++i)
{
pri = do_work(&arr[0]);
- if (pri != 8237.25)
+ diff = pri - 8237.25;
+
+ if (diff > EPS || -diff > EPS)
abort ();
return 0;
program SIMD3
use SIMD3_mod
- double precision :: a(128), b(128), sum, sum_ref
+ double precision :: a(128), b(128), sum, sum_ref, diff
+ double precision, parameter :: EPS = 0.0000000000000001
call work(a, b, 128, sum)
call work_ref(a, b, 128, sum_ref)
- if (sum .ne. sum_ref) call abort
+ diff = sum - sum_ref
+
+ if (diff > EPS .or. -diff > EPS) call abort
end program
program simd_8f
use work
implicit none
- real :: pri, arr(1000)
+ real :: pri, arr(1000), diff
integer :: i
+ integer, parameter :: EPS = 0.005
do i = 1, 1000
P(i) = i
arr(i) = (i-1) * 1.8
end do
pri = do_work(arr)
- if (pri .ne. 8237.25) call abort ()
+
+ diff = pri - 8237.25
+
+ if (diff > EPS .or. -diff > EPS) call abort
end program