OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c++/] [task-4.C] - Blame information for rev 837

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 273 jeremybenn
#include 
2
extern "C" void *memset (void *, int, __SIZE_TYPE__);
3
extern "C" void abort (void);
4
 
5
int e;
6
 
7
void
8
baz (int i, int *p, int j, int *q)
9
{
10
  if (p[0] != 1 || p[i] != 3 || q[0] != 2 || q[j] != 4)
11
    #pragma omp atomic
12
      e++;
13
}
14
 
15
void
16
foo (int i, int j)
17
{
18
  int p[i + 1];
19
  int q[j + 1];
20
  memset (p, 0, sizeof (p));
21
  memset (q, 0, sizeof (q));
22
  p[0] = 1;
23
  p[i] = 3;
24
  q[0] = 2;
25
  q[j] = 4;
26
  #pragma omp task firstprivate (p, q)
27
    baz (i, p, j, q);
28
}
29
 
30
int
31
main ()
32
{
33
  #pragma omp parallel num_threads (4)
34
    foo (5 + omp_get_thread_num (), 7 + omp_get_thread_num ());
35
  if (e)
36
    abort ();
37
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.