mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-07 23:22:11 +01:00
22 lines
358 B
C
22 lines
358 B
C
/*
|
|
* @@name: task_dep.2c
|
|
* @@type: C
|
|
* @@compilable: yes
|
|
* @@linkable: yes
|
|
* @@expect: success
|
|
*/
|
|
#include <stdio.h>
|
|
int main()
|
|
{
|
|
int x = 1;
|
|
#pragma omp parallel
|
|
#pragma omp single
|
|
{
|
|
#pragma omp task shared(x) depend(in: x)
|
|
printf("x = %d\n", x);
|
|
#pragma omp task shared(x) depend(out: x)
|
|
x = 2;
|
|
}
|
|
return 0;
|
|
}
|