I ran a parallel loop as follows:

#define imax 257

#define jmax 129

#define kmax 129

#define nn 50

static float arr1[imax][jmax]kmax];

static float arr2[imax][jmax][kmax];

#pragma acc region

{

for(n=1;n<nn-1;++n){

for(i=1 ; i<imax-1 ; ++i){

for(j=1 ; j<jmax-1 ; ++j){

for(k=1 ; k<kmax-1 ; ++k){

arr1_[j][k] = arr2[j][k];

}

}

}

for(i=1 ; i<imax-1 ; ++i){

for(j=1 ; j<jmax-1 ; ++j){

for(k=1 ; k<kmax-1 ; ++k){

arr2[j][k] = arr1[j][k] ;

}

}

}

} /* end n loop */
}
I got the following message when compiling:
Parallelization would require privatization of array arr1[i2+1][i3+1][1:kmax-2]
I carried out privatization of arrays as follows:
static float arr1[nn][imax][jmax]kmax];
static float arr2[nn][imax][jmax][kmax];
#pragma acc region
{
for(n=1;n<nn-1;++n){
for(i=1 ; i<imax-1 ; ++i){
for(j=1 ; j<jmax-1 ; ++j){
for(k=1 ; k<kmax-1 ; ++k){
arr1[n][j][k] = arr2[n][j][k];
}
}
}
for(i=1 ; i<imax-1 ; ++i){
for(j=1 ; j<jmax-1 ; ++j){
for(k=1 ; k<kmax-1 ; ++k){
arr2[n][j][k] = arr1[n][j][k] ;
}
}
}
} /* end n loop */

}

I got the out_of_memory error when running the code:

call to cuMemAlloc returned error 2: Out of memory

Are there different ways of privatization of array so as not to get the out_of_memory error?

Thanks in advance,

Viet_