public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/7] [OpenACC] Dynamic reference counts for mapped data
@ 2020-05-22 22:16 Julian Brown
  2020-05-22 22:16 ` [PATCH 1/7] [OpenACC] Missing unlocking on error paths in attach/detach code Julian Brown
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Julian Brown @ 2020-05-22 22:16 UTC (permalink / raw)
  To: gcc-patches; +Cc: thomas, Catherine_Moore, jakub

After questions from Thomas:

https://gcc.gnu.org/pipermail/gcc-patches/2020-May/545399.html

here is a patch series that adjusts how reference counting works
(again) for dynamic data lifetimes in OpenACC.  Since the "overhaul"
patch was applied,

https://gcc.gnu.org/legacy-ml/gcc-patches/2019-12/msg01249.html

dynamic data lifetimes have been represented by counting "excess"
references beyond those that are explicitly part of the linked splay
tree/target memory descriptor data structure.  This allowed self-test
code to be written to ensure that reference counts remained consistent
throughout execution.

However, there were some awkward corner-cases, which -- though fixable
-- made some of the code more complex than it could have been.  So,
this patch series reverts the dynamic reference counting implementation
to the previous semantics, which are that the dynamic reference count
recorded in each mapping's splay tree key corresponds more directly to
the source-level semantics (i.e. "enter data" operations increment the
reference count, and "exit data" operations decrement it).

This is not a plain revert of the "overhaul" patch above.  I have tried
to keep various refactoring introduced in that patch in place, though
I have re-introduced some error checking that the aforementioned patch
removed.

I have also managed to adjust the (still optional, development use only)
self-checking code to be able to work with the "dynamic_refcount" scheme.
A couple of patches containing minor cleanups are included too.

Tested with offloading to NVPTX (as a series). OK?

Julian Brown (7):
  [OpenACC] Missing unlocking on error paths in attach/detach code
  [OpenACC] Adjust dynamic reference count semantics
  [OpenACC] Don't pass kind array via pointer to goacc_enter_datum
  [OpenACC] Fix incompatible copyout for acc_map_data (PR92843)
  [OpenACC] Distinguish structural/dynamic mappings in libgomp
  [OpenACC] Reference count self-checking (dynamic_refcount version)
  [OpenACC] Stricter dynamic data unmapping testing (WIP)

 libgomp/libgomp.h                             |  29 +-
 libgomp/oacc-int.h                            |   3 +
 libgomp/oacc-mem.c                            | 306 +++++++++++++-----
 libgomp/oacc-parallel.c                       |  27 ++
 libgomp/target.c                              | 231 +++++++++++--
 .../libgomp.oacc-c-c++-common/pr92843-1.c     |   1 -
 .../libgomp.oacc-c-c++-common/refcounting-1.c |  31 ++
 .../libgomp.oacc-c-c++-common/refcounting-2.c |  31 ++
 8 files changed, 542 insertions(+), 117 deletions(-)
 create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/refcounting-1.c
 create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/refcounting-2.c

-- 
2.23.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-07-10 12:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 22:16 [PATCH 0/7] [OpenACC] Dynamic reference counts for mapped data Julian Brown
2020-05-22 22:16 ` [PATCH 1/7] [OpenACC] Missing unlocking on error paths in attach/detach code Julian Brown
2020-06-04 18:00   ` Thomas Schwinge
2020-05-22 22:16 ` [PATCH 2/7] [OpenACC] Adjust dynamic reference count semantics Julian Brown
2020-06-03 12:36   ` Thomas Schwinge
2020-06-03 15:19     ` Thomas Schwinge
2020-06-05 22:03       ` Julian Brown
2020-06-04 18:26   ` [OpenACC] Don't open-code 'gomp_remove_var' in 'acc_unmap_data' (was: [PATCH 2/7] [OpenACC] Adjust dynamic reference count semantics) Thomas Schwinge
2020-05-22 22:16 ` [PATCH 3/7] [OpenACC] Don't pass kind array via pointer to goacc_enter_datum Julian Brown
2020-06-25 10:52   ` Thomas Schwinge
2020-07-10 12:06     ` Julian Brown
2020-05-22 22:16 ` [PATCH 4/7] [OpenACC] Fix incompatible copyout for acc_map_data (PR92843) Julian Brown
2020-05-22 22:21 ` [PATCH 5/7] [OpenACC] Distinguish structural/dynamic mappings in libgomp Julian Brown
2020-05-22 22:21 ` [PATCH 6/7] [OpenACC] Reference count self-checking (dynamic_refcount version) Julian Brown
2020-06-18 18:40   ` Julian Brown
2020-05-22 22:21 ` [PATCH 7/7] [OpenACC] Stricter dynamic data unmapping testing (WIP) Julian Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).