2022-11-04 09:35:42 -07:00

25 lines
436 B
C

/*
* @@name: tasking.1
* @@type: C
* @@operation: compile
* @@expect: success
* @@version: omp_3.0
*/
struct node {
struct node *left;
struct node *right;
};
extern void process(struct node *);
void traverse( struct node *p )
{
if (p->left)
#pragma omp task // p is firstprivate by default
traverse(p->left);
if (p->right)
#pragma omp task // p is firstprivate by default
traverse(p->right);
process(p);
}