diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2019-12-09 23:52:47 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gcc.gnu.org> | 2019-12-09 23:52:47 +0100 |
commit | cec41816c18f2857f8362825222ef4de0a6e596e (patch) | |
tree | 258c6e8f788f3f353c45169fb5e8046aedcfa81a /libgomp/oacc-mem.c | |
parent | e103542bc8606e7b5033631e33bdfb9e29191b24 (diff) |
[PR92503] [OpenACC] Don't silently 'acc_unmap_data' in 'acc_free'
libgomp/
PR libgomp/92503
* oacc-mem.c (acc_free): Error out instead of 'acc_unmap_data'.
* testsuite/libgomp.oacc-c-c++-common/acc_free-pr92503-1.c: New
file.
* testsuite/libgomp.oacc-c-c++-common/acc_free-pr92503-2.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/acc_free-pr92503-3-2.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/acc_free-pr92503-3.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/acc_free-pr92503-4-2.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/acc_free-pr92503-4.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/clauses-1.c: Adjust.
* testsuite/libgomp.oacc-c-c++-common/context-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/context-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/context-3.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/context-4.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-13.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-14.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-18.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-91.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/nested-1.c: Likewise.
From-SVN: r279146
Diffstat (limited to 'libgomp/oacc-mem.c')
-rw-r--r-- | libgomp/oacc-mem.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libgomp/oacc-mem.c b/libgomp/oacc-mem.c index 480b9fbb71b..81ebddf7580 100644 --- a/libgomp/oacc-mem.c +++ b/libgomp/oacc-mem.c @@ -121,9 +121,6 @@ acc_malloc (size_t s) return res; } -/* 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. */ void acc_free (void *d) { @@ -152,13 +149,15 @@ acc_free (void *d) (unless you got that null from acc_malloc). */ if ((k = lookup_dev (acc_dev->openacc.data_environ, d, 1))) { - void *offset; - - offset = d - k->tgt->tgt_start + k->tgt_offset; - + void *offset = d - k->tgt->tgt_start + k->tgt_offset; + void *h = k->host_start + offset; + size_t h_size = k->host_end - k->host_start; gomp_mutex_unlock (&acc_dev->lock); - - acc_unmap_data ((void *)(k->host_start + offset)); + /* PR92503 "[OpenACC] Behavior of 'acc_free' if the memory space is still + used in a mapping". */ + gomp_fatal ("refusing to free device memory space at %p that is still" + " mapped at [%p,+%d]", + d, h, (int) h_size); } else gomp_mutex_unlock (&acc_dev->lock); |