Hello,
I’m a new user of openacc an pgi compilers and I’m following your tutorials of youtube (Introduction to Parallel Programming with OpenACC - Part 1 - YouTube)
But I’m encountering an error. Compiling for multicore works fine. Although, when i compile for a tesla GPU, like this:
make jsolvec.exe OPT="-ta:tesla:cc60 -Minfo=accel"
I get the following errors:
PGCC-S-0155-Compiler failed to translate accelerator region (see -Minfo messages): Could not find allocated-variable index for symbol (jsolvec.cpp: 129)
The code that it’s generating the problem is this:
while ((residual > TOLERANCE) && (iters < max_iters)) {
++iters;
// swap input and output vectors
xtmp = xnew;
xnew = xold;
xold = xtmp;
#pragma acc parallel loop
for (i = 0; i < nsize; ++i) {
TYPE rsum = (TYPE)0;
#pragma acc loop reduction(+:residual)
for (j = 0; j < nsize; ++j) {
if (i != j) rsum += A[i*nsize + j] * xold[j];
}
xnew[i] = (b[i] - rsum) / A[i*nsize + i];
}
}
where line 129 is the first for loop.
Why is this happening?