diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgomp/testsuite/libgomp.c/appendix-a/a.36.1.c	Fri Jul 17 14:47:48 2009 +0900
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+
+#include <omp.h>
+#include <stdlib.h>
+void
+do_by_16 (float *x, int iam, int ipoints)
+{
+}
+
+void
+a36 (float *x, int npoints)
+{
+  int iam, ipoints;
+  omp_set_dynamic (0);
+  omp_set_num_threads (16);
+#pragma omp parallel shared(x, npoints) private(iam, ipoints)
+  {
+    if (omp_get_num_threads () != 16)
+      abort ();
+    iam = omp_get_thread_num ();
+    ipoints = npoints / 16;
+    do_by_16 (x, iam, ipoints);
+  }
+}
+
+int main()
+{
+  float a[10];
+  a36 (a, 10);
+  return 0;
+}