[Bug libgomp/69858] OpenACC no free memory

tschwinge at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 19 16:22:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69858

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |openacc
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID
           Assignee|unassigned at gcc dot gnu.org      |tschwinge at gcc dot gnu.org

--- Comment #1 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
As I understand it, the issue is that when using a copyout(pi) clause, the
value of the pi variable in the device memory is undefined (is not
initialized), whereas when using a copy(pi) clause, the value from the host
(0.0f) will be copied to the device.  The way your code is laid out, however,
it expects pi to be initialized to zero.

And then, as you write, 'the GPU memory "remembers" the result', because of
using the same memory location for pi in each run, which happened to have an
initial value of zero, but 3.14[...] after the first run, and so on.

There should be a warning about the uninitialized use of pi on the device; I
filed PR69876 for that.

I'm closing this, but please re-open if you don't agree with my reasoning.


More information about the Gcc-bugs mailing list