[v3,0/3] libgomp: OpenMP low-latency omp_alloc

Message ID 20231203003224.1638841-1-ams@codesourcery.com
Headers
Series libgomp: OpenMP low-latency omp_alloc |

Message

Andrew Stubbs Dec. 3, 2023, 12:32 a.m. UTC
  This patch series is a rework of the patch series posted in August.

https://patchwork.sourceware.org/project/gcc/list/?series=23045&state=%2A&archive=both

The series implements device-specific allocators and adds a low-latency
allocator for both GPUs architectures.

This time the omp_low_lat_mem_alloc does not work because the default
traits are incompatible (GPU low-latency memory is not accessible to
other teams).  I've also included documentation and addressed the
comments from Tobias's review.

Andrew

Andrew Stubbs (3):
  libgomp, nvptx: low-latency memory allocator
  openmp, nvptx: low-lat memory access traits
  amdgcn, libgomp: low-latency allocator

 gcc/config/gcn/gcn-builtins.def               |   2 +
 gcc/config/gcn/gcn.cc                         |  16 +-
 libgomp/allocator.c                           | 266 +++++++-----
 libgomp/basic-allocator.c                     | 380 ++++++++++++++++++
 libgomp/config/gcn/allocator.c                | 127 ++++++
 libgomp/config/gcn/libgomp-gcn.h              |   6 +
 libgomp/config/gcn/team.c                     |  12 +
 libgomp/config/nvptx/allocator.c              | 141 +++++++
 libgomp/config/nvptx/team.c                   |  18 +
 libgomp/libgomp.h                             |   3 -
 libgomp/libgomp.texi                          |  40 +-
 libgomp/plugin/plugin-gcn.c                   |  35 +-
 libgomp/plugin/plugin-nvptx.c                 |  23 +-
 libgomp/testsuite/libgomp.c/omp_alloc-1.c     |  66 +++
 libgomp/testsuite/libgomp.c/omp_alloc-2.c     |  72 ++++
 libgomp/testsuite/libgomp.c/omp_alloc-3.c     |  49 +++
 libgomp/testsuite/libgomp.c/omp_alloc-4.c     | 197 +++++++++
 libgomp/testsuite/libgomp.c/omp_alloc-5.c     |  71 ++++
 libgomp/testsuite/libgomp.c/omp_alloc-6.c     | 118 ++++++
 .../testsuite/libgomp.c/omp_alloc-traits.c    |  66 +++
 20 files changed, 1595 insertions(+), 113 deletions(-)
 create mode 100644 libgomp/basic-allocator.c
 create mode 100644 libgomp/config/gcn/allocator.c
 create mode 100644 libgomp/config/nvptx/allocator.c
 create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-1.c
 create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-2.c
 create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-3.c
 create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-4.c
 create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-5.c
 create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-6.c
 create mode 100644 libgomp/testsuite/libgomp.c/omp_alloc-traits.c
  

Comments

Tobias Burnus Dec. 4, 2023, 3:34 p.m. UTC | #1
Hi Andrew,

On 03.12.23 01:32, Andrew Stubbs wrote:
> This patch series is a rework of the patch series posted in August.
> https://patchwork.sourceware.org/project/gcc/list/?series=23045&state=%2A&archive=both
>
> The series implements device-specific allocators and adds a low-latency
> allocator for both GPUs architectures.

As mentioned, can you also update libgomp/libgomp.texi?

I don't have a strong preference where in that file nor how it is
documented, but it seems to make sense to document as follows:

(A) Document the GCN/NVPX specifics on the respective pages below
https://gcc.gnu.org/onlinedocs/libgomp/Offload-Target-Specifics.html

(B) To make it possible to find it, @ref'er to that page from:

And https://gcc.gnu.org/onlinedocs/libgomp/Memory-allocation.html

(May be just 'See also:' or 'For offload-device specifics to memory
allocation, see' or something like that.)

(C) Maybe, some wording should be added to OMP_ALLOCATOR that the
cgrouppteam/thread pre-defined allocators use (implementation choice)
the low-latency memory space; for instance, add a sentence under the
first table – or use the first table 'omp_low_lat_mem_space
(implementation choice)' or some other wordings which make clear what
GCC does but that the spec does not specify this.

https://gcc.gnu.org/onlinedocs/libgomp/OMP_005fALLOCATOR.html

Maybe we should add to OMP_ALLOCATOR also a @ref to "Offload Target
Specifics"?

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
  
Tobias Burnus Dec. 4, 2023, 3:53 p.m. UTC | #2
I cannot "grep" – all three patches do contain .texi changes. I have a
comment to them, but I will comment individually on them.

Hence, scratch:

On 04.12.23 16:34, Tobias Burnus wrote:
> On 03.12.23 01:32, Andrew Stubbs wrote:
>> This patch series is a rework of the patch series posted in August.
>> https://patchwork.sourceware.org/project/gcc/list/?series=23045&state=%2A&archive=both
>>
>>
>> The series implements device-specific allocators and adds a low-latency
>> allocator for both GPUs architectures.
>
> As mentioned, can you also update libgomp/libgomp.texi?

Sorry for missing those changes.

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955