Mercurial > hg > CbC > CbC_gcc
comparison libgomp/testsuite/libgomp.c/icv-1.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 #include <omp.h> | |
2 #include <stdlib.h> | |
3 | |
4 int | |
5 main (void) | |
6 { | |
7 int err = 0; | |
8 | |
9 omp_set_num_threads (4); | |
10 if (omp_get_max_threads () != 4) | |
11 abort (); | |
12 #pragma omp parallel reduction(|: err) num_threads(1) | |
13 { | |
14 if (omp_get_max_threads () != 4) | |
15 err |= 1; | |
16 omp_set_num_threads (6); | |
17 #pragma omp task if(0) shared(err) | |
18 { | |
19 if (omp_get_max_threads () != 6) | |
20 err |= 2; | |
21 omp_set_num_threads (5); | |
22 if (omp_get_max_threads () != 5) | |
23 err |= 4; | |
24 } | |
25 if (omp_get_max_threads () != 6) | |
26 err |= 8; | |
27 } | |
28 if (err) | |
29 abort (); | |
30 if (omp_get_max_threads () != 4) | |
31 abort (); | |
32 return 0; | |
33 } |