source:
CIVL/mods/dev.civl.com/examples/omp/simplifier/pointerAddAlias.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 273 bytes | |
| Rev | Line | |
|---|---|---|
| [e80ab56] | 1 | #include "omp.h" |
| 2 | #define N 10 | |
| 3 | ||
| 4 | ||
| 5 | int main() { | |
| 6 | int a[N*10][N]; | |
| 7 | int (*p)[N], (*q)[N]; | |
| 8 | ||
| 9 | p = a; q = p + 3; | |
| 10 | #pragma omp parallel for firstprivate(p, q) shared(a) | |
| 11 | for (int i = 0; i < N-1; i++) | |
| 12 | for (int j = 0; j < N-1; j++) { | |
| 13 | q[i][j] = p[i][j] + 3; | |
| 14 | } | |
| 15 | } |
Note:
See TracBrowser
for help on using the repository browser.
