Mercurial > hg > CbC > CbC_gcc
comparison libgomp/testsuite/libgomp.c/appendix-a/a.36.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 /* { dg-do run } */ | |
2 | |
3 #include <omp.h> | |
4 #include <stdlib.h> | |
5 void | |
6 do_by_16 (float *x, int iam, int ipoints) | |
7 { | |
8 } | |
9 | |
10 void | |
11 a36 (float *x, int npoints) | |
12 { | |
13 int iam, ipoints; | |
14 omp_set_dynamic (0); | |
15 omp_set_num_threads (16); | |
16 #pragma omp parallel shared(x, npoints) private(iam, ipoints) | |
17 { | |
18 if (omp_get_num_threads () != 16) | |
19 abort (); | |
20 iam = omp_get_thread_num (); | |
21 ipoints = npoints / 16; | |
22 do_by_16 (x, iam, ipoints); | |
23 } | |
24 } | |
25 | |
26 int main() | |
27 { | |
28 float a[10]; | |
29 a36 (a, 10); | |
30 return 0; | |
31 } |