https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69858
Bug ID: 69858 Summary: OpenACC no free memory Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: oliveriandrea at gmail dot com CC: jakub at gcc dot gnu.org Target Milestone: --- Hi, i have compiled GCC SNAPSHOT 20160214 with nvpt-offload support. i have tested it with this code /***********************************************/ #include <stdio.h> #define N 2000000000 #define vl 1024 int main(void) { double pi = 0.0f; long long i; double t; #pragma acc data copyout(pi) { #pragma acc parallel vector_length(vl) #pragma acc loop gang worker vector reduction(+:pi) private(t) for (i=0; i<N; i++) { t= (double)((i+0.5)/N); pi +=4.0/(1.0+t*t); } } printf("pi=%11.10f\n",pi/N); return 0; } /************************************************/ the result is correct pi=3,14.... but if i run again the program the output is pi =6.28..... and if i run again pi=9..... it seems that the GPU memory "remembers" the result... if i substitute #pragma acc data copyout(pi) with #pragma acc data copy(pi) the program works correctly.