diff options
author | Maxim Blumenthal <maxim.blumenthal@intel.com> | 2015-07-13 13:08:13 +0000 |
---|---|---|
committer | Ilya Verbin <ilya.verbin@intel.com> | 2015-07-13 13:08:13 +0000 |
commit | 386222fe5f804e83293a403348320a31de25dd49 (patch) | |
tree | ad1a204b7bacefa1c784c6ab505f105cc7ab8557 /libgomp/testsuite/libgomp.c | |
parent | c96f9c22846faac38ddfc9f47542daa2f13409be (diff) |
Update libgomp/testsuite/*/examples-4/* according to latest version (4.0.2)
2015-07-13 Maxim Blumenthal <maxim.blumenthal@intel.com>
* testsuite/libgomp.c++/examples-4/e.53.2.C: Renamed to...
* testsuite/libgomp.c++/examples-4/declare_target-2.C: ...this.
* testsuite/libgomp.c++/examples-4/e.51.5.C: Renamed to...
* testsuite/libgomp.c++/examples-4/target_data-5.C: ...this.
* testsuite/libgomp.c/examples-4/e.56.3.c: Renamed to...
* testsuite/libgomp.c/examples-4/array_sections-3.c: ...this.
* testsuite/libgomp.c/examples-4/e.56.4.c: Renamed to...
* testsuite/libgomp.c/examples-4/array_sections-4.c: ...this.
* testsuite/libgomp.c/examples-4/e.55.1.c: Renamed to...
* testsuite/libgomp.c/examples-4/async_target-1.c: ...this.
* testsuite/libgomp.c/examples-4/e.55.2.c: Renamed to...
* testsuite/libgomp.c/examples-4/async_target-2.c: ...this.
(vec_mult_ref): Remove v1 and v2 arguments, turn them into local
variables.
(vec_mult): Likewise. Add #pragma omp taskwait.
(main): Adjust caller.
* testsuite/libgomp.c/examples-4/e.53.1.c: Renamed to...
* testsuite/libgomp.c/examples-4/declare_target-1.c: ...this.
* testsuite/libgomp.c/examples-4/e.53.3.c: Renamed to...
* testsuite/libgomp.c/examples-4/declare_target-3.c: ...this.
* testsuite/libgomp.c/examples-4/e.53.4.c: Renamed to...
* testsuite/libgomp.c/examples-4/declare_target-4.c: ...this.
* testsuite/libgomp.c/examples-4/e.53.5.c: Renamed to...
* testsuite/libgomp.c/examples-4/declare_target-5.c: ...this.
* testsuite/libgomp.c/examples-4/e.57.1.c: Renamed to...
* testsuite/libgomp.c/examples-4/device-1.c: ...this.
* testsuite/libgomp.c/examples-4/e.57.2.c: Renamed to...
* testsuite/libgomp.c/examples-4/device-2.c: ...this.
* testsuite/libgomp.c/examples-4/e.57.3.c: Renamed to...
* testsuite/libgomp.c/examples-4/device-3.c: ...this.
* testsuite/libgomp.c/examples-4/simd-1.c: New file.
* testsuite/libgomp.c/examples-4/simd-2.c: New file.
* testsuite/libgomp.c/examples-4/simd-3.c: New file.
* testsuite/libgomp.c/examples-4/simd-4.c: New file.
* testsuite/libgomp.c/examples-4/simd-5.c: New file.
* testsuite/libgomp.c/examples-4/simd-6.c: New file.
* testsuite/libgomp.c/examples-4/simd-7.c: New file.
* testsuite/libgomp.c/examples-4/simd-8.c: New file.
* testsuite/libgomp.c/examples-4/e.50.1.c: Renamed to...
* testsuite/libgomp.c/examples-4/target-1.c: ...this.
* testsuite/libgomp.c/examples-4/e.50.2.c: Renamed to...
* testsuite/libgomp.c/examples-4/target-2.c: ...this.
* testsuite/libgomp.c/examples-4/e.50.3.c: Renamed to...
* testsuite/libgomp.c/examples-4/target-3.c: ...this.
* testsuite/libgomp.c/examples-4/e.50.4.c: Renamed to...
* testsuite/libgomp.c/examples-4/target-4.c: ...this.
* testsuite/libgomp.c/examples-4/e.50.5.c: Renamed to...
* testsuite/libgomp.c/examples-4/target-5.c: ...this.
* testsuite/libgomp.c/examples-4/e.51.1.c: Renamed to...
* testsuite/libgomp.c/examples-4/target_data-1.c: ...this.
* testsuite/libgomp.c/examples-4/e.51.2.c: Renamed to...
* testsuite/libgomp.c/examples-4/target_data-2.c: ...this.
* testsuite/libgomp.c/examples-4/e.51.3.c: Renamed to...
* testsuite/libgomp.c/examples-4/target_data-3.c: ...this.
* testsuite/libgomp.c/examples-4/e.51.4.c: Renamed to...
* testsuite/libgomp.c/examples-4/target_data-4.c: ...this.
* testsuite/libgomp.c/examples-4/e.51.6.c: Renamed to...
* testsuite/libgomp.c/examples-4/target_data-6.c: ...this.
* testsuite/libgomp.c/examples-4/e.51.7.c: Renamed to...
* testsuite/libgomp.c/examples-4/target_data-7.c: ...this.
* testsuite/libgomp.c/examples-4/e.52.1.c: Renamed to...
* testsuite/libgomp.c/examples-4/target_update-1.c: ...this.
* testsuite/libgomp.c/examples-4/e.52.2.c: Renamed to...
* testsuite/libgomp.c/examples-4/target_update-2.c: ...this.
* testsuite/libgomp.c/examples-4/task_dep-1.c: New file.
* testsuite/libgomp.c/examples-4/task_dep-2.c: New file.
* testsuite/libgomp.c/examples-4/task_dep-3.c: New file.
* testsuite/libgomp.c/examples-4/task_dep-4.c: New file.
* testsuite/libgomp.c/examples-4/task_dep-5.c: New file.
* testsuite/libgomp.c/examples-4/e.54.2.c: Renamed to...
* testsuite/libgomp.c/examples-4/teams-2.c: ...this.
* testsuite/libgomp.c/examples-4/e.54.3.c: Renamed to...
* testsuite/libgomp.c/examples-4/teams-3.c: ...this.
* testsuite/libgomp.c/examples-4/e.54.4.c: Renamed to...
* testsuite/libgomp.c/examples-4/teams-4.c: ...this.
* testsuite/libgomp.c/examples-4/e.54.5.c: Renamed to...
* testsuite/libgomp.c/examples-4/teams-5.c: ...this.
* testsuite/libgomp.c/examples-4/e.54.6.c: Renamed to...
* testsuite/libgomp.c/examples-4/teams-6.c: ...this.
* testsuite/libgomp.fortran/examples-4/e.56.3.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/array_sections-3.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.56.4.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/array_sections-4.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.55.1.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/async_target-1.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.55.2.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/async_target-2.f90: ...this.
(vec_mult): Add !$omp taskwait.
* testsuite/libgomp.fortran/examples-4/e.53.1.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/declare_target-1.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.53.2.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/declare_target-2.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.53.3.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/declare_target-3.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.53.4.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/declare_target-4.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.53.5.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/declare_target-5.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.57.1.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/device-1.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.57.2.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/device-2.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.57.3.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/device-3.f90: ...this.
* testsuite/libgomp.fortran/examples-4/simd-1.f90: New file.
* testsuite/libgomp.fortran/examples-4/simd-2.f90: New file.
* testsuite/libgomp.fortran/examples-4/simd-3.f90: New file.
* testsuite/libgomp.fortran/examples-4/simd-4.f90: New file.
* testsuite/libgomp.fortran/examples-4/simd-5.f90: New file.
* testsuite/libgomp.fortran/examples-4/simd-6.f90: New file.
* testsuite/libgomp.fortran/examples-4/simd-7.f90: New file.
* testsuite/libgomp.fortran/examples-4/simd-8.f90: New file.
* testsuite/libgomp.fortran/examples-4/e.50.1.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target-1.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.50.2.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target-2.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.50.3.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target-3.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.50.4.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target-4.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.50.5.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target-5.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.51.1.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target_data-1.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.51.2.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target_data-2.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.51.3.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target_data-3.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.51.4.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target_data-4.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.51.5.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target_data-5.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.51.6.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target_data-6.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.51.7.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target_data-7.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.52.1.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target_update-1.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.52.2.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/target_update-2.f90: ...this.
* testsuite/libgomp.fortran/examples-4/task_dep-1.f90: New file.
* testsuite/libgomp.fortran/examples-4/task_dep-2.f90: New file.
* testsuite/libgomp.fortran/examples-4/task_dep-3.f90: New file.
* testsuite/libgomp.fortran/examples-4/task_dep-4.f90: New file.
* testsuite/libgomp.fortran/examples-4/task_dep-5.f90: New file.
* testsuite/libgomp.fortran/examples-4/e.54.2.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/teams-2.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.54.3.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/teams-3.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.54.4.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/teams-4.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.54.5.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/teams-5.f90: ...this.
* testsuite/libgomp.fortran/examples-4/e.54.6.f90: Renamed to...
* testsuite/libgomp.fortran/examples-4/teams-6.f90: ...this.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@225735 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/testsuite/libgomp.c')
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/array_sections-3.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.56.3.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/array_sections-4.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.56.4.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/async_target-1.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.55.1.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/async_target-2.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.55.2.c) | 13 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/declare_target-1.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.53.1.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/declare_target-3.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.53.3.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/declare_target-4.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.53.4.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/declare_target-5.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.53.5.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/device-1.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.57.1.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/device-2.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.57.2.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/device-3.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.57.3.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/simd-1.c | 65 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/simd-2.c | 90 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/simd-3.c | 61 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/simd-4.c | 58 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/simd-5.c | 76 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/simd-6.c | 105 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/simd-7.c | 41 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/simd-8.c | 49 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target-1.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.50.1.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target-2.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.50.2.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target-3.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.50.3.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target-4.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.50.4.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target-5.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.50.5.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target_data-1.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.51.1.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target_data-2.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.51.2.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target_data-3.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.51.3.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target_data-4.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.51.4.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target_data-6.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.51.6.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target_data-7.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.51.7.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target_update-1.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.52.1.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/target_update-2.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.52.2.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/task_dep-1.c | 17 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/task_dep-2.c | 17 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/task_dep-3.c | 20 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/task_dep-4.c | 20 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/task_dep-5.c | 81 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/teams-2.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.54.2.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/teams-3.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.54.3.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/teams-4.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.54.4.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/teams-5.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.54.5.c) | 0 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/examples-4/teams-6.c (renamed from libgomp/testsuite/libgomp.c/examples-4/e.54.6.c) | 0 |
42 files changed, 708 insertions, 5 deletions
diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.56.3.c b/libgomp/testsuite/libgomp.c/examples-4/array_sections-3.c index 4f4649ae244..4f4649ae244 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.56.3.c +++ b/libgomp/testsuite/libgomp.c/examples-4/array_sections-3.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.56.4.c b/libgomp/testsuite/libgomp.c/examples-4/array_sections-4.c index 66234d76f7b..66234d76f7b 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.56.4.c +++ b/libgomp/testsuite/libgomp.c/examples-4/array_sections-4.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.55.1.c b/libgomp/testsuite/libgomp.c/examples-4/async_target-1.c index b2e1f1feef8..b2e1f1feef8 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.55.1.c +++ b/libgomp/testsuite/libgomp.c/examples-4/async_target-1.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.55.2.c b/libgomp/testsuite/libgomp.c/examples-4/async_target-2.c index f03cae372ff..ce63328a7b4 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.55.2.c +++ b/libgomp/testsuite/libgomp.c/examples-4/async_target-2.c @@ -19,8 +19,9 @@ void init (float *a, float *b, int n) } #pragma omp end declare target -void vec_mult_ref (float *p, float *v1, float *v2, int n) +void vec_mult_ref(float *p, int n) { + float *v1, *v2; int i; v1 = (float *) malloc (n * sizeof (float)); @@ -35,8 +36,9 @@ void vec_mult_ref (float *p, float *v1, float *v2, int n) free (v2); } -void vec_mult (float *p, float *v1, float *v2, int n) +void vec_mult(float *p, int n) { + float *v1, *v2; int i; #pragma omp task shared(v1, v2) depend(out: v1, v2) @@ -64,6 +66,8 @@ void vec_mult (float *p, float *v1, float *v2, int n) free (v1); free (v2); } + + #pragma omp taskwait } void check (float *a, float *b, int n) @@ -81,10 +85,9 @@ int main () { float *p1 = (float *) malloc (N * sizeof (float)); float *p2 = (float *) malloc (N * sizeof (float)); - float *v1, *v2; - vec_mult_ref (p1, v1, v2, N); - vec_mult (p2, v1, v2, N); + vec_mult_ref (p1, N); + vec_mult (p2, N); check (p1, p2, N); diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.53.1.c b/libgomp/testsuite/libgomp.c/examples-4/declare_target-1.c index beca8555780..beca8555780 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.53.1.c +++ b/libgomp/testsuite/libgomp.c/examples-4/declare_target-1.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.53.3.c b/libgomp/testsuite/libgomp.c/examples-4/declare_target-3.c index 8025335722a..8025335722a 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.53.3.c +++ b/libgomp/testsuite/libgomp.c/examples-4/declare_target-3.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.53.4.c b/libgomp/testsuite/libgomp.c/examples-4/declare_target-4.c index db70460b309..db70460b309 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.53.4.c +++ b/libgomp/testsuite/libgomp.c/examples-4/declare_target-4.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.53.5.c b/libgomp/testsuite/libgomp.c/examples-4/declare_target-5.c index b550f1ff540..b550f1ff540 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.53.5.c +++ b/libgomp/testsuite/libgomp.c/examples-4/declare_target-5.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.57.1.c b/libgomp/testsuite/libgomp.c/examples-4/device-1.c index f7c84fb4c14..f7c84fb4c14 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.57.1.c +++ b/libgomp/testsuite/libgomp.c/examples-4/device-1.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.57.2.c b/libgomp/testsuite/libgomp.c/examples-4/device-2.c index be204bd76f5..be204bd76f5 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.57.2.c +++ b/libgomp/testsuite/libgomp.c/examples-4/device-2.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.57.3.c b/libgomp/testsuite/libgomp.c/examples-4/device-3.c index 8a0cf7c200d..8a0cf7c200d 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.57.3.c +++ b/libgomp/testsuite/libgomp.c/examples-4/device-3.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/simd-1.c b/libgomp/testsuite/libgomp.c/examples-4/simd-1.c new file mode 100644 index 00000000000..5baaf307639 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/simd-1.c @@ -0,0 +1,65 @@ +/* { dg-do run } */ +/* { dg-additional-options "-msse2" { target sse2_runtime } } */ +/* { dg-additional-options "-mavx" { target avx_runtime } } */ + +#define N 100 +#define OFF 32 +#define EPS 0.0000000000000001 + +#include <stdlib.h> + +void init(double *a, double *a_ref, double *b, double *c, int n, int ioff) +{ + int i; + for ( i = 0; i < n; i++ ) + { + a[i] = i*i; + a_ref[i] = a[i]; + b[i] = i+i; + } + + int s = -1; + for ( i = 0; i < n+ioff; i++ ) + { + c[i] = s*3; + s = -s; + } +} + +void star( double *a, double *b, double *c, int n, int *ioff ) +{ + int i; + #pragma omp simd + for ( i = 0; i < n; i++ ) + a[i] *= b[i] * c[i+ *ioff]; +} + +void star_ref( double *a, double *b, double *c, int n, int *ioff ) +{ + int i; + for ( i = 0; i < n; i++ ) + a[i] *= b[i] * c[i+ *ioff]; +} + +void check (double *a, double *b) +{ + int i; + for (i = 0; i < N; i++) + if (a[i] - b[i] > EPS || b[i] - a[i] > EPS) + abort (); +} + +int main () +{ + double a[N], a_ref[N], b[N], c[N+OFF]; + int ioff = OFF; + + init(a, a_ref, b, c, N, ioff); + + star(a, b, c, N, &ioff); + star_ref(a_ref, b, c, N, &ioff); + + check(a, a_ref); + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/simd-2.c b/libgomp/testsuite/libgomp.c/examples-4/simd-2.c new file mode 100644 index 00000000000..6527db9d279 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/simd-2.c @@ -0,0 +1,90 @@ +/* { dg-do run { target vect_simd_clones } } */ +/* { dg-additional-options "-msse2" { target sse2_runtime } } */ +/* { dg-additional-options "-mavx" { target avx_runtime } } */ + +#define N 100 +#define EPS 0.0000000000000001 + +#include <stdlib.h> + +void init(double *a, double *a_ref, double *b, int n) +{ + int i; + for ( i=0; i<N; i++ ) + { + a[i] = i; + a_ref[i] = i; + b[i] = N-i; + } +} + +#pragma omp declare simd uniform(fact) +double add1(double a, double b, double fact) +{ + double c; + c = a + b + fact; + return c; +} + +#pragma omp declare simd uniform(a,b,fact) linear(i:1) +double add2(double *a, double *b, int i, double fact) +{ + double c; + c = a[i] + b[i] + fact; + return c; +} + +#pragma omp declare simd uniform(fact) linear(a,b:1) +double add3(double *a, double *b, double fact) +{ + double c; + c = *a + *b + fact; + return c; +} + +void work( double *a, double *b, int n ) +{ + int i; + double tmp; + #pragma omp simd private(tmp) + for ( i = 0; i < n; i++ ) { + tmp = add1( a[i], b[i], 1.0); + a[i] = add2( a, b, i, 1.0) + tmp; + a[i] = add3(&a[i], &b[i], 1.0); + } +} + +void work_ref( double *a, double *b, int n ) +{ + int i; + double tmp; + for ( i = 0; i < n; i++ ) { + tmp = add1( a[i], b[i], 1.0); + a[i] = add2( a, b, i, 1.0) + tmp; + a[i] = add3(&a[i], &b[i], 1.0); + } +} + +void check (double *a, double *b) +{ + int i; + for (i = 0; i < N; i++) + if (a[i] - b[i] > EPS || b[i] - a[i] > EPS) + abort (); +} + + +int main () +{ + int i; + double a[N], a_ref[N], b[N]; + + init(a, a_ref, b, N); + + work(a, b, N ); + work_ref(a_ref, b, N ); + + check(a, a_ref); + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/simd-3.c b/libgomp/testsuite/libgomp.c/examples-4/simd-3.c new file mode 100644 index 00000000000..9f33713d356 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/simd-3.c @@ -0,0 +1,61 @@ +/* { dg-do run } */ +/* { dg-additional-options "-msse2" { target sse2_runtime } } */ +/* { dg-additional-options "-mavx" { target avx_runtime } } */ + +#define N 100 +#define EPS 0.0000000000000001 + +#include <stdlib.h> + +void init(double *a, double *a_ref, double *b, int n) +{ + int i, s = -1; + for ( i = 0; i < n; i++ ) + { + a[i] = i*i*s; + a_ref[i] = a[i]; + b[i] = i+i; + s = -s; + } +} + +double work( double *a, double *b, int n ) +{ + int i; + double tmp, sum; + sum = 0.0; + #pragma omp simd private(tmp) reduction(+:sum) + for (i = 0; i < n; i++) { + tmp = a[i] + b[i]; + sum += tmp; + } + return sum; +} + +double work_ref( double *a, double *b, int n ) +{ + int i; + double tmp, sum; + sum = 0.0; + for (i = 0; i < n; i++) { + tmp = a[i] + b[i]; + sum += tmp; + } + return sum; +} + +int main () +{ + double a[N], a_ref[N], b[N]; + int res, ref; + + init(a, a_ref, b, N); + + res = work(a, b, N); + ref = work_ref(a_ref, b, N); + + if (res != ref) + abort (); + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/simd-4.c b/libgomp/testsuite/libgomp.c/examples-4/simd-4.c new file mode 100644 index 00000000000..1aa0425010d --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/simd-4.c @@ -0,0 +1,58 @@ +/* { dg-do run } */ +/* { dg-additional-options "-msse2" { target sse2_runtime } } */ +/* { dg-additional-options "-mavx" { target avx_runtime } } */ + +#define N 128 +#define M 16 +#define EPS 0.0000000000000001 +#define SAFELEN 16 + +#include <stdlib.h> + +void init(double *a, double *b, int n) +{ + int i, s = -1; + for ( i = 0; i < n; i++ ) + { + a[i] = i*i*s; + b[i] = a[i]; + s = -s; + } +} + +void work( double *b, int n, int m ) +{ + int i; + #pragma omp simd safelen(SAFELEN) + for (i = m; i < n; i++) + b[i] = b[i-m] - 1.0f; +} + +void work_ref( double *b, int n, int m ) +{ + int i; + for (i = m; i < n; i++) + b[i] = b[i-m] - 1.0f; +} + +void check (double *a, double *b) +{ + int i; + for (i = 0; i < N; i++) + if (a[i] - b[i] > EPS || b[i] - a[i] > EPS) + abort (); +} + +int main () +{ + double b[N], b_ref[N]; + + init(b, b_ref, N); + + work(b, N, M); + work(b_ref, N, M); + + check(b, b_ref); + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/simd-5.c b/libgomp/testsuite/libgomp.c/examples-4/simd-5.c new file mode 100644 index 00000000000..ce037acdaee --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/simd-5.c @@ -0,0 +1,76 @@ +/* { dg-do run } */ +/* { dg-additional-options "-msse2" { target sse2_runtime } } */ +/* { dg-additional-options "-mavx" { target avx_runtime } } */ + +#define N 128 +#define M 16 +#define EPS 0.0000000000000001 +#define SAFELEN 16 + +#include <stdlib.h> + +void init(double a[N][N], double b[N][N], int n) +{ + int i, j, s = -1; + for (i = 0; i < n; i++) + { + for (j = 0; j < n; j++) + { + a[i][j] = i * j * s; + b[i][j] = i + j + s; + s = -s; + } + } +} + +void work( double a[N][N], double b[N][N], double c[N][N], int n ) +{ + int i, j; + double tmp; + #pragma omp for simd collapse(2) private(tmp) + for (i = 0; i < n; i++) + { + for (j = 0; j < n; j++) + { + tmp = a[i][j] + b[i][j]; + c[i][j] = tmp; + } + } +} + +void work_ref( double a[N][N], double b[N][N], double c[N][N], int n ) +{ + int i, j; + double tmp; + for (i = 0; i < n; i++) + { + for (j = 0; j < n; j++) + { + tmp = a[i][j] + b[i][j]; + c[i][j] = tmp; + } + } +} + +void check (double a[N][N], double b[N][N]) +{ + int i, j; + for (i = 0; i < N; i++) + for (j = 0; j < N; j++) + if (a[i][j] - b[i][j] > EPS || b[i][j] - a[i][j] > EPS) + abort (); +} + +int main () +{ + double a[N][N], b[N][N], c[N][N], c_ref[N][N]; + + init(a, b, N); + + work(a, b, c, N); + work_ref(a, b, c_ref, N); + + check(c, c_ref); + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/simd-6.c b/libgomp/testsuite/libgomp.c/examples-4/simd-6.c new file mode 100644 index 00000000000..a326b455b42 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/simd-6.c @@ -0,0 +1,105 @@ +/* { dg-do run { target vect_simd_clones } } */ +/* { dg-additional-options "-msse2" { target sse2_runtime } } */ +/* { dg-additional-options "-mavx" { target avx_runtime } } */ + +#define N 100 +#define EPS 0.000001 + +#include <stdlib.h> +#include <stdio.h> + +void init(int *b, float *y, int n) +{ + int i, s = -1; + for ( i=0; i<N; i++ ) + { + b[i] = i*i*s; + y[i] = b[i] * 0.1f; + s = -s; + } +} + +#pragma omp declare simd linear(p:1) notinbranch +int foo(int *p){ + *p = *p + 10; + return *p; +} + +int myaddint(int *a, int *b, int n) +{ +#pragma omp simd + for (int i=0; i<n; i++){ + a[i] = foo(&b[i]); /* foo is not called under a condition */ + } + return a[n-1]; +} + +int myaddint_ref(int *a, int *b, int n) +{ + for (int i=0; i<n; i++){ + a[i] = foo(&b[i]); + } + return a[n-1]; +} + +#pragma omp declare simd linear(p:1) inbranch +float goo(float *p){ + *p = *p + 18.5f; + return *p; +} + +int myaddfloat(float *x, float *y, int n) +{ +#pragma omp simd + for (int i=0; i<n; i++){ + x[i] = (x[i] > y[i]) ? goo(&y[i]) : y[i]; + /* goo is called under the condition (or within a branch) */ + } + return x[n-1]; +} + +int myaddfloat_ref(float *x, float *y, int n) +{ + for (int i=0; i<n; i++){ + x[i] = (x[i] > y[i]) ? goo(&y[i]) : y[i]; + } + return x[n-1]; +} + +void check_addint (int *a, int *b) +{ + int i; + for (i = 0; i < N; i++) + if (a[i] != b[i]) + abort (); +} + +void check_addfloat (float *a, float *b) +{ + int i; + for (i = 0; i < N; i++) + if (a[i] - b[i] > EPS || b[i] - a[i] > EPS) + abort (); +} + +int main () +{ + int i; + int a[N], a_ref[N], b[N]; + float x[N], x_ref[N], y[N]; + + init(a, x, N); + init(b, y, N); + myaddint(a, b, N); + myaddfloat(x, y, N); + + init(a_ref, x_ref, N); + init(b, y, N); + myaddint_ref(a_ref, b, N); + myaddfloat_ref(x_ref, y, N); + + check_addint(a, a_ref); + check_addfloat(x, x_ref); + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/simd-7.c b/libgomp/testsuite/libgomp.c/examples-4/simd-7.c new file mode 100644 index 00000000000..4aab962b719 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/simd-7.c @@ -0,0 +1,41 @@ +/* { dg-do run { target vect_simd_clones } } */ +/* { dg-additional-options "-msse2" { target sse2_runtime } } */ +/* { dg-additional-options "-mavx" { target avx_runtime } } */ + +#include <stdio.h> +#include <stdlib.h> + +#define N 45 +int a[N], a_ref[N], b[N]; + +#pragma omp declare simd inbranch +int fib( int n ) +{ + if (n <= 2) + return n; + else { + return fib(n-1) + fib(n-2); + } +} + +int main(void) +{ + int i; + +#pragma omp simd + for (i=0; i < N; i++) + b[i] = i; + +#pragma omp simd + for (i=0; i < N; i++) + a[i] = fib(b[i]); + + for (i=0; i < N; i++) + a_ref[i] = fib(b[i]); + + for (i=0; i < N; i++) + if (a[i] != a_ref[i]) + abort (); + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/simd-8.c b/libgomp/testsuite/libgomp.c/examples-4/simd-8.c new file mode 100644 index 00000000000..397e2a340aa --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/simd-8.c @@ -0,0 +1,49 @@ +/* { dg-do run } */ +/* { dg-additional-options "-msse2" { target sse2_runtime } } */ +/* { dg-additional-options "-mavx" { target avx_runtime } } */ + +#include <stdlib.h> +#include <math.h> + +int P[1000]; +float A[1000]; + +float do_work(float *arr) +{ + float pri; + +#pragma omp simd lastprivate(pri) + for (int i = 0; i < 999; ++i) + { + int j = P[i]; + + pri = 0.5f; + if (j % 2 == 0) + { + pri = A[j+1] + arr[i]; + } + A[j] = pri * 1.5f; + pri = pri + A[j]; + } + + return pri; +} + +int main(void) +{ + float pri, arr[1000]; + + for (int i = 0; i < 1000; ++i) + { + P[i] = i; + A[i] = i * 1.5f; + arr[i] = i * 1.8f; + } + + pri = do_work(&arr[0]); + + if (pri != 8237.25) + abort (); + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.50.1.c b/libgomp/testsuite/libgomp.c/examples-4/target-1.c index 45adbe00f3c..45adbe00f3c 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.50.1.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target-1.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.50.2.c b/libgomp/testsuite/libgomp.c/examples-4/target-2.c index 55d667aa775..55d667aa775 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.50.2.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target-2.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.50.3.c b/libgomp/testsuite/libgomp.c/examples-4/target-3.c index 8d5125f07ee..8d5125f07ee 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.50.3.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target-3.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.50.4.c b/libgomp/testsuite/libgomp.c/examples-4/target-4.c index 545f02ae9e4..545f02ae9e4 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.50.4.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target-4.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.50.5.c b/libgomp/testsuite/libgomp.c/examples-4/target-5.c index 1853fba684b..1853fba684b 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.50.5.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target-5.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.51.1.c b/libgomp/testsuite/libgomp.c/examples-4/target_data-1.c index 6b0331bf04c..6b0331bf04c 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.51.1.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target_data-1.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.51.2.c b/libgomp/testsuite/libgomp.c/examples-4/target_data-2.c index ee8f150c1a0..ee8f150c1a0 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.51.2.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target_data-2.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.51.3.c b/libgomp/testsuite/libgomp.c/examples-4/target_data-3.c index abb283801f8..abb283801f8 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.51.3.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target_data-3.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.51.4.c b/libgomp/testsuite/libgomp.c/examples-4/target_data-4.c index d2948ae1b54..d2948ae1b54 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.51.4.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target_data-4.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.51.6.c b/libgomp/testsuite/libgomp.c/examples-4/target_data-6.c index affeb490021..affeb490021 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.51.6.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target_data-6.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.51.7.c b/libgomp/testsuite/libgomp.c/examples-4/target_data-7.c index c18d4803cf3..c18d4803cf3 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.51.7.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target_data-7.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.52.1.c b/libgomp/testsuite/libgomp.c/examples-4/target_update-1.c index 727d475f6c7..727d475f6c7 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.52.1.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target_update-1.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.52.2.c b/libgomp/testsuite/libgomp.c/examples-4/target_update-2.c index 51262bb24a9..51262bb24a9 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.52.2.c +++ b/libgomp/testsuite/libgomp.c/examples-4/target_update-2.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/task_dep-1.c b/libgomp/testsuite/libgomp.c/examples-4/task_dep-1.c new file mode 100644 index 00000000000..8d397a55e7c --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/task_dep-1.c @@ -0,0 +1,17 @@ +/* { dg-do run } */ + +#include <stdlib.h> +int main() +{ + int x = 1; + #pragma omp parallel + #pragma omp single + { + #pragma omp task shared(x) depend(out: x) + x = 2; + #pragma omp task shared(x) depend(in: x) + if (x != 2) + abort (); + } + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/task_dep-2.c b/libgomp/testsuite/libgomp.c/examples-4/task_dep-2.c new file mode 100644 index 00000000000..f583f0978e2 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/task_dep-2.c @@ -0,0 +1,17 @@ +/* { dg-do run } */ + +#include <stdlib.h> +int main() +{ + int x = 1; + #pragma omp parallel + #pragma omp single + { + #pragma omp task shared(x) depend(in: x) + if (x != 1) + abort (); + #pragma omp task shared(x) depend(out: x) + x = 2; + } + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/task_dep-3.c b/libgomp/testsuite/libgomp.c/examples-4/task_dep-3.c new file mode 100644 index 00000000000..189d5e0aa15 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/task_dep-3.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ + +#include <stdlib.h> + +int main() +{ + int x = 0; + #pragma omp parallel + #pragma omp single + { + #pragma omp task shared(x) depend(out: x) + x = 1; + #pragma omp task shared(x) depend(out: x) + x = 2; + #pragma omp taskwait + if (x != 1 && x != 2) + abort (); + } + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/task_dep-4.c b/libgomp/testsuite/libgomp.c/examples-4/task_dep-4.c new file mode 100644 index 00000000000..77aa57a4c25 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/task_dep-4.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ + +#include <stdlib.h> +int main() +{ + int x = 1; + #pragma omp parallel + #pragma omp single + { + #pragma omp task shared(x) depend(out: x) + x = 2; + #pragma omp task shared(x) depend(in: x) + if (x != 2) + abort (); + #pragma omp task shared(x) depend(in: x) + if (x != 2) + abort (); + } + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/task_dep-5.c b/libgomp/testsuite/libgomp.c/examples-4/task_dep-5.c new file mode 100644 index 00000000000..066edc723b3 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/examples-4/task_dep-5.c @@ -0,0 +1,81 @@ +/* { dg-do run } */ + +#define N 128 +#define BS 16 +#define EPS 0.000001 + +#include <stdlib.h> + +void matmul_depend (float A[N][N], float B[N][N], float C[N][N]) +{ + int i, j, k, ii, jj, kk; + for (i = 0; i < N; i+=BS) + for (j = 0; j < N; j+=BS) + for (k = 0; k < N; k+=BS) +// Note 1: i, j, k, A, B, C are firstprivate by default +// Note 2: A, B and C are just pointers +#pragma omp task private(ii, jj, kk) \ + depend ( in: A[i:BS][k:BS], B[k:BS][j:BS] ) \ + depend ( inout: C[i:BS][j:BS] ) + for (ii = i; ii < i+BS; ii++ ) + for (jj = j; jj < j+BS; jj++ ) + for (kk = k; kk < k+BS; kk++ ) + C[ii][jj] = C[ii][jj] + A[ii][kk] * B[kk][jj]; +} + +void matmul_ref (float A[N][N], float B[N][N], float C[N][N]) +{ + int i, j, k; + + for (i = 0; i < N; i++) + for (j = 0; j < N; j++) + for (k = 0; k < N; k++) + C[i][j] += A[i][k] * B[k][j]; +} + +void init (float A[N][N], float B[N][N]) +{ + int i, j, s = -1; + for (i = 0; i < N; i++) + for (j = 0; j < N; j++) + { + A[i][j] = i * j * s; + B[i][j] = i + j; + s = -s; + } +} + +void init_zero (float A[N][N], float B[N][N]) +{ + int i, j, s = -1; + for (i = 0; i < N; i++) + for (j = 0; j < N; j++) + { + A[i][j] = 0; + B[i][j] = 0; + } +} + +void check (float A[N][N], float B[N][N]) +{ + int i, j; + for (i = 0; i < N; i++) + for (j = 0; j < N; j++) + if (A[i][j] - B[i][j] > EPS || B[i][j] - A[i][j] > EPS) + abort (); +} + +int main () +{ + float A[N][N], B[N][N], C[N][N], C_ref[N][N]; + + init (A, B); + init_zero (C, C_ref); + + matmul_depend (A, B, C); + matmul_ref (A, B, C_ref); + + check (C, C_ref); + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.54.2.c b/libgomp/testsuite/libgomp.c/examples-4/teams-2.c index 8bbbc355b17..8bbbc355b17 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.54.2.c +++ b/libgomp/testsuite/libgomp.c/examples-4/teams-2.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.54.3.c b/libgomp/testsuite/libgomp.c/examples-4/teams-3.c index b6708785884..b6708785884 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.54.3.c +++ b/libgomp/testsuite/libgomp.c/examples-4/teams-3.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.54.4.c b/libgomp/testsuite/libgomp.c/examples-4/teams-4.c index 9aef78ecfba..9aef78ecfba 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.54.4.c +++ b/libgomp/testsuite/libgomp.c/examples-4/teams-4.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.54.5.c b/libgomp/testsuite/libgomp.c/examples-4/teams-5.c index ac99744ebe3..ac99744ebe3 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.54.5.c +++ b/libgomp/testsuite/libgomp.c/examples-4/teams-5.c diff --git a/libgomp/testsuite/libgomp.c/examples-4/e.54.6.c b/libgomp/testsuite/libgomp.c/examples-4/teams-6.c index 388582b51cd..388582b51cd 100644 --- a/libgomp/testsuite/libgomp.c/examples-4/e.54.6.c +++ b/libgomp/testsuite/libgomp.c/examples-4/teams-6.c |