testsuite/libgomp.c/appendix-a/a.36.1.c

Go to the documentation of this file.
00001 /* { dg-do run } */
00002 
00003 #include <omp.h>
00004 #include <stdlib.h>
00005 void
00006 do_by_16 (float *x, int iam, int ipoints)
00007 {
00008 }
00009 
00010 void
00011 a36 (float *x, int npoints)
00012 {
00013   int iam, ipoints;
00014   omp_set_dynamic (0);
00015   omp_set_num_threads (16);
00016 #pragma omp parallel shared(x, npoints) private(iam, ipoints)
00017   {
00018     if (omp_get_num_threads () != 16)
00019       abort ();
00020     iam = omp_get_thread_num ();
00021     ipoints = npoints / 16;
00022     do_by_16 (x, iam, ipoints);
00023   }
00024 }
00025 
00026 int main()
00027 {
00028   float a[10];
00029   a36 (a, 10);
00030   return 0;
00031 }

Generated on Fri Apr 5 05:38:10 2013 for Libgomp by  doxygen 1.4.7