mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-04 05:41:33 +01:00
23 lines
393 B
C
23 lines
393 B
C
/*
|
|
* @@name: collapse.1c
|
|
* @@type: C
|
|
* @@compilable: yes
|
|
* @@linkable: no
|
|
* @@expect: success
|
|
*/
|
|
|
|
void bar(float *a, int i, int j, int k);
|
|
|
|
int kl, ku, ks, jl, ju, js, il, iu,is;
|
|
|
|
void sub(float *a)
|
|
{
|
|
int i, j, k;
|
|
|
|
#pragma omp for collapse(2) private(i, k, j)
|
|
for (k=kl; k<=ku; k+=ks)
|
|
for (j=jl; j<=ju; j+=js)
|
|
for (i=il; i<=iu; i+=is)
|
|
bar(a,i,j,k);
|
|
}
|