I am also getting this error while jacobi relaxation example. Following is the complete code, let me know what is the problem.

#include <stdio.h>

#include <time.h>

#include <math.h>

#define NN 4096

#define NM 4096

double A[NN][NM];

double Anew[NN][NM];

int main(int argc, char** argv)

{

const int n = NN;

const int m = NM;

const int iter_max = 1000;

const double tol = 1.0e-6;

double error = 1.0;

memset(A, 0, n * m * sizeof(double));

memset(Anew, 0, n * m * sizeof(double));

for (int j = 0; j < n; j++)

{

A[j][0] = 1.0;

Anew[j][0] = 1.0;

}

printf(“Jacobi relaxation Calculation: %d x %d mesh\n”, n, m);

double stime = time(NULL);

int iter = 0;

#pragma acc data copy(A) create(Anew)

while ( error > tol && iter < iter_max )

{

error = 0.0;

#pragma acc kernels loop gang(32) vector(16)

for( int j = 1; j < n-1; j++)

{

#pragma acc loop gang(16) vector(32)

for( int i = 1; i < m-1; i++ )

{

Anew[j] _= 0.25 * ( A[j][i+1] + A[j][i-1]

- A[j-1] + A[j+1]);

error = fmax( error, fabs(Anew[j] - A[j]));

}

}

#pragma acc kernels

for( int j = 1; j < n-1; j++)

{

#pragma acc loop gang(16) vector(32)

for( int i = 1; i < m-1; i++ )

{

A[j] = Anew[j];

}

}

if(iter % 100 == 0) printf("%5d, %0.6f\n", iter, error);

iter++;

}

double etime = time(NULL);

double runtime = etime - stime;

printf(" total: %f s\n", runtime / 1000);

}_