comparison libgomp/testsuite/libgomp.c/collapse-2.c @ 0:a06113de4d67

first commit
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2009 14:47:48 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:a06113de4d67
1 /* { dg-do run } */
2
3 #include <stdlib.h>
4 #include <omp.h>
5
6 int
7 main (void)
8 {
9 int i, j, k, l = 0, f = 0;
10 int m1 = 4, m2 = -5, m3 = 17;
11
12 #pragma omp parallel for num_threads (8) collapse(3) \
13 schedule(static, 9) reduction(+:l) \
14 firstprivate(f)
15 for (i = -2; i < m1; i++)
16 for (j = m2; j < -2; j++)
17 {
18 for (k = 13; k < m3; k++)
19 {
20 if (omp_get_num_threads () == 8
21 && ((i + 2) * 12 + (j + 5) * 4 + (k - 13)
22 != (omp_get_thread_num () * 9
23 + f++)))
24 l++;
25 }
26 }
27 if (l)
28 abort ();
29 return 0;
30 }