[all-commits] [llvm/llvm-project] 5216a9: [Libmoptarget] Enable the shared allocator for AMDGPU

Joseph Huber via All-commits all-commits at lists.llvm.org
Mon Feb 20 06:44:31 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5216a9bfb002705fcaee7a078cbbb538e806eea1
      https://github.com/llvm/llvm-project/commit/5216a9bfb002705fcaee7a078cbbb538e806eea1
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
    M openmp/libomptarget/test/api/omp_device_managed_memory.c
    M openmp/libomptarget/test/api/omp_host_pinned_memory.c
    M openmp/libomptarget/test/api/omp_host_pinned_memory_alloc.c

  Log Message:
  -----------
  [Libmoptarget] Enable the shared allocator for AMDGPU

Currently, the AMDGPU plugin did not support the `TARGET_ALLOC_SHARED`
allocation kind. We used the fine-grained memory allocator for the
"host" alloc when this is most likely not what is intended. Fine-grained
memory can be accessed by all agents, so it should be considered shared.
This patch removes the use of fine-grained memory for the host
allocator. A later patch will add support for this via the
`hsa_amd_memory_lock` method.

Reviewed By: kevinsala

Differential Revision: https://reviews.llvm.org/D143771


  Commit: 5d560b6966b722e45085f010bb98d2b081c461c7
      https://github.com/llvm/llvm-project/commit/5d560b6966b722e45085f010bb98d2b081c461c7
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
    M openmp/libomptarget/test/api/omp_host_pinned_memory.c
    M openmp/libomptarget/test/api/omp_host_pinned_memory_alloc.c

  Log Message:
  -----------
  [Libomptarget] Implement the host memory allocator with fine grained memory

This patch should enable the "Host" allocation using fine-grained
memory. As far as I understand, this is HSA managed memory that is
availible to the host, but can be accessed by the device as well.
The original patch that introduced these extensions just stipulated that
it's "non-migratable" memory, which is most likely true because it's
managed by the host but accessible by the device. This should work
sufficiently well for what we expect the "host" allocation to do.

Depends on D143771

Reviewed By: kevinsala

Differential Revision: https://reviews.llvm.org/D143775


Compare: https://github.com/llvm/llvm-project/compare/fa1eb2eb1606...5d560b6966b7


More information about the All-commits mailing list