I am using Community Edition 18.4 and GTX1080 Ti.
The code is working in serial but adding acc, the host memory is growing constantly till computer is blocking.
UPDATE
I rewrite the question with a simpler example (memory grows because of accessing parallel region many-many times)
question
how I can avoid the memory to grow so much that is blocking the computer?
#include <stdio.h>
#include <openacc.h>
int main(void) {
for (int k = 0; k < 32000; k++)
for (int m = 0; m < 32000; m++)
for (int p = 0; p < 32000; p++)
for (int q = 0; q < 32000; q++)
{
#pragma acc parallel loop gang
for (int j = 0; j < 10; j++)
#pragma acc loop vector
for (int i = 0; i < 10; i++)
int a = 0;
}
return 0;
}