public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/5] openmp: Handle pinned and unified shared memory.
@ 2022-03-08 11:30 Hafiz Abid Qadeer
  2022-03-08 11:30 ` [PATCH 1/5] openmp: Add -foffload-memory Hafiz Abid Qadeer
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Hafiz Abid Qadeer @ 2022-03-08 11:30 UTC (permalink / raw)
  To: gcc-patches, fortran; +Cc: jakub, ams, joseph

This patch series add support for unified shared memory (USM) and pinned
memory. The support in libgomp is for nvptx offloading only.  A new
command line option -foffload-memory allows user to choose either USM
or pinned memory. The USM can also be enabled using requires construct.

When USM us in use, calls to memory allocation function like malloc are
changed to omp_alloc with appropriate allocator.  No transformations are
required for the pinned memory which is implemented using mlockall so is
only available on Linux.

Andrew Stubbs (4):
  openmp: Add -foffload-memory
  openmp: allow requires unified_shared_memory
  openmp, nvptx: ompx_unified_shared_mem_alloc
  openmp: -foffload-memory=pinned

Hafiz Abid Qadeer (1):
  openmp: Use libgomp memory allocation functions with unified shared
    memory.

 gcc/c/c-parser.cc                             |  13 +-
 gcc/common.opt                                |  16 ++
 gcc/coretypes.h                               |   7 +
 gcc/cp/parser.cc                              |  13 +-
 gcc/doc/invoke.texi                           |  16 +-
 gcc/fortran/openmp.cc                         |  10 +-
 gcc/omp-low.cc                                | 220 ++++++++++++++++++
 gcc/passes.def                                |   1 +
 .../c-c++-common/gomp/alloc-pinned-1.c        |  28 +++
 gcc/testsuite/c-c++-common/gomp/usm-1.c       |   4 +
 gcc/testsuite/c-c++-common/gomp/usm-2.c       |  34 +++
 gcc/testsuite/c-c++-common/gomp/usm-3.c       |  32 +++
 gcc/testsuite/g++.dg/gomp/usm-1.C             |  32 +++
 gcc/testsuite/g++.dg/gomp/usm-2.C             |  30 +++
 gcc/testsuite/g++.dg/gomp/usm-3.C             |  38 +++
 gcc/testsuite/gfortran.dg/gomp/usm-1.f90      |   6 +
 gcc/testsuite/gfortran.dg/gomp/usm-2.f90      |  16 ++
 gcc/testsuite/gfortran.dg/gomp/usm-3.f90      |  13 ++
 gcc/tree-pass.h                               |   1 +
 libgomp/allocator.c                           |  13 +-
 libgomp/config/linux/allocator.c              |  70 ++++--
 libgomp/config/nvptx/allocator.c              |   6 +
 libgomp/libgomp-plugin.h                      |   3 +
 libgomp/libgomp.h                             |   6 +
 libgomp/libgomp.map                           |   5 +
 libgomp/omp.h.in                              |   4 +
 libgomp/omp_lib.f90.in                        |   8 +
 libgomp/plugin/plugin-nvptx.c                 |  45 +++-
 libgomp/target.c                              |  70 ++++++
 libgomp/testsuite/libgomp.c++/usm-1.C         |  54 +++++
 libgomp/testsuite/libgomp.c/alloc-pinned-7.c  |  66 ++++++
 libgomp/testsuite/libgomp.c/usm-1.c           |  24 ++
 libgomp/testsuite/libgomp.c/usm-2.c           |  32 +++
 libgomp/testsuite/libgomp.c/usm-3.c           |  35 +++
 libgomp/testsuite/libgomp.c/usm-4.c           |  36 +++
 libgomp/testsuite/libgomp.c/usm-5.c           |  28 +++
 libgomp/testsuite/libgomp.c/usm-6.c           |  70 ++++++
 37 files changed, 1075 insertions(+), 30 deletions(-)
 create mode 100644 gcc/testsuite/c-c++-common/gomp/alloc-pinned-1.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/usm-1.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/usm-2.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/usm-3.c
 create mode 100644 gcc/testsuite/g++.dg/gomp/usm-1.C
 create mode 100644 gcc/testsuite/g++.dg/gomp/usm-2.C
 create mode 100644 gcc/testsuite/g++.dg/gomp/usm-3.C
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/usm-1.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/usm-2.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/usm-3.f90
 create mode 100644 libgomp/testsuite/libgomp.c++/usm-1.C
 create mode 100644 libgomp/testsuite/libgomp.c/alloc-pinned-7.c
 create mode 100644 libgomp/testsuite/libgomp.c/usm-1.c
 create mode 100644 libgomp/testsuite/libgomp.c/usm-2.c
 create mode 100644 libgomp/testsuite/libgomp.c/usm-3.c
 create mode 100644 libgomp/testsuite/libgomp.c/usm-4.c
 create mode 100644 libgomp/testsuite/libgomp.c/usm-5.c
 create mode 100644 libgomp/testsuite/libgomp.c/usm-6.c

-- 
2.25.1


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

end of thread, other threads:[~2023-02-09 11:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 11:30 [PATCH 0/5] openmp: Handle pinned and unified shared memory Hafiz Abid Qadeer
2022-03-08 11:30 ` [PATCH 1/5] openmp: Add -foffload-memory Hafiz Abid Qadeer
2022-03-08 11:30 ` [PATCH 2/5] openmp: allow requires unified_shared_memory Hafiz Abid Qadeer
2022-03-08 11:30 ` [PATCH 3/5] openmp, nvptx: ompx_unified_shared_mem_alloc Hafiz Abid Qadeer
2022-03-08 11:30 ` [PATCH 4/5] openmp: Use libgomp memory allocation functions with unified shared memory Hafiz Abid Qadeer
2022-04-02 12:04   ` Andrew Stubbs
2022-04-02 12:42     ` Andrew Stubbs
2022-03-08 11:30 ` [PATCH 5/5] openmp: -foffload-memory=pinned Hafiz Abid Qadeer
2022-03-30 22:40   ` Andrew Stubbs
2023-02-09 11:16   ` [og12] 'c-c++-common/gomp/alloc-pinned-1.c' -> 'libgomp.c-c++-common/alloc-pinned-1.c' (was: [PATCH 5/5] openmp: -foffload-memory=pinned) Thomas Schwinge
2022-04-13 13:14 ` [PATCH 0/5] openmp: Handle pinned and unified shared memory Andrew Stubbs
2022-04-20 13:25 ` [PATCH] openmp: Handle unified address memory Andrew Stubbs

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).