Commit e70b6ad7 by Alexander Monakov Committed by Alexander Monakov

libgomp: fix teams-3/4 testcases

	* testsuite/libgomp.c/examples-4/teams-3.c: Add missing reduction
	clause.
	* testsuite/libgomp.c/examples-4/teams-4.c: Likewise.
	* testsuite/libgomp.fortran/examples-4/teams-3.f90: Add missing
	reduction and map clauses.
	* testsuite/libgomp.fortran/examples-4/teams-4.f90: Likewise.

From-SVN: r233086
parent 31e2b5a3
2016-02-02 Alexander Monakov <amonakov@ispras.ru>
* testsuite/libgomp.c/examples-4/teams-3.c: Add missing reduction
clause.
* testsuite/libgomp.c/examples-4/teams-4.c: Likewise.
* testsuite/libgomp.fortran/examples-4/teams-3.f90: Add missing
reduction and map clauses.
* testsuite/libgomp.fortran/examples-4/teams-4.f90: Likewise.
2016-02-02 James Norris <jnorris@codesourcery.com> 2016-02-02 James Norris <jnorris@codesourcery.com>
* testsuite/libgomp.oacc-c-c++-common/declare-4.c: Fix clause. * testsuite/libgomp.oacc-c-c++-common/declare-4.c: Fix clause.
......
...@@ -31,7 +31,8 @@ float dotprod (float B[], float C[], int n) ...@@ -31,7 +31,8 @@ float dotprod (float B[], float C[], int n)
int i; int i;
float sum = 0; float sum = 0;
#pragma omp target teams map(to: B[0:n], C[0:n]) map(tofrom: sum) #pragma omp target teams map(to: B[0:n], C[0:n]) \
map(tofrom: sum) reduction(+:sum)
#pragma omp distribute parallel for reduction(+:sum) #pragma omp distribute parallel for reduction(+:sum)
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
sum += B[i] * C[i]; sum += B[i] * C[i];
......
...@@ -32,7 +32,7 @@ float dotprod (float B[], float C[], int n) ...@@ -32,7 +32,7 @@ float dotprod (float B[], float C[], int n)
float sum = 0; float sum = 0;
#pragma omp target map(to: B[0:n], C[0:n]) map(tofrom:sum) #pragma omp target map(to: B[0:n], C[0:n]) map(tofrom:sum)
#pragma omp teams num_teams(8) thread_limit(16) #pragma omp teams num_teams(8) thread_limit(16) reduction(+:sum)
#pragma omp distribute parallel for reduction(+:sum) \ #pragma omp distribute parallel for reduction(+:sum) \
dist_schedule(static, 1024) \ dist_schedule(static, 1024) \
schedule(static, 64) schedule(static, 64)
......
...@@ -14,7 +14,8 @@ function dotprod (B, C, N) result(sum) ...@@ -14,7 +14,8 @@ function dotprod (B, C, N) result(sum)
real :: B(N), C(N), sum real :: B(N), C(N), sum
integer :: N, i integer :: N, i
sum = 0.0e0 sum = 0.0e0
!$omp target teams map(to: B, C) !$omp target teams map(to: B, C) map(tofrom: sum) &
!$omp& reduction(+:sum)
!$omp distribute parallel do reduction(+:sum) !$omp distribute parallel do reduction(+:sum)
do i = 1, N do i = 1, N
sum = sum + B(i) * C(i) sum = sum + B(i) * C(i)
......
...@@ -14,8 +14,8 @@ function dotprod (B, C, n) result(sum) ...@@ -14,8 +14,8 @@ function dotprod (B, C, n) result(sum)
real :: B(N), C(N), sum real :: B(N), C(N), sum
integer :: N, i integer :: N, i
sum = 0.0e0 sum = 0.0e0
!$omp target map(to: B, C) !$omp target map(to: B, C) map(tofrom: sum)
!$omp teams num_teams(8) thread_limit(16) !$omp teams num_teams(8) thread_limit(16) reduction(+:sum)
!$omp distribute parallel do reduction(+:sum) & !$omp distribute parallel do reduction(+:sum) &
!$omp& dist_schedule(static, 1024) schedule(static, 64) !$omp& dist_schedule(static, 1024) schedule(static, 64)
do i = 1, N do i = 1, N
......
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