source:
CIVL/mods/dev.civl.com/examples/omp/simplifier/pointerAddAlias2.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 304 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 | int x = 0; | |
| 9 | ||
| 10 | p = a; q = p + x; // x is taken as * | |
| 11 | #pragma omp parallel for firstprivate(p, q) shared(a) | |
| 12 | for (int i = 0; i < N-1; i++) | |
| 13 | for (int j = 0; j < N-1; j++) { | |
| 14 | q[i][j] = p[i][j] + 3; | |
| 15 | } | |
| 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
