https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92503
Bug ID: 92503 Summary: [OpenACC] Behavior of 'acc_free' if the memory space is still used in a mapping Product: gcc Version: unknown Status: UNCONFIRMED Keywords: openacc Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: tschwinge at gcc dot gnu.org CC: jakub at gcc dot gnu.org, jules at gcc dot gnu.org Target Milestone: --- Currently, we state ('libgomp/oacc-mem.c:acc_free') that: "OpenACC 2.0a (3.2.16) doesn't specify what to do in the event the device address is mapped. We choose to check if it mapped, and if it is, to unmap it." (That is, 'acc_free' looks up 'acc_hostptr', and if found, then does an implicit 'acc_unmap_data' on that, and only then frees the memory space.) This, seems counter-intuitive for me. I'm not aware of "free" functions generally first cleaning up any usage of the respective memory space, which isn't even possible in the general case.