[Openmp-commits] [PATCH] D133128: [libomptarget] Enable the device allocator for AMDGPU

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Sep 1 10:26:45 PDT 2022


jhuber6 created this revision.
jhuber6 added reviewers: JonChesterfield, ronlieb, tianshilei1992, jdoerfert.
Herald added subscribers: kosarev, kerbowa, t-tye, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: openmp-commits, wdng.
Herald added a project: OpenMP.

This patch adds support for the device memory type, this is currently equivalent
to the default type so it should be treated as the same.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133128

Files:
  openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
  openmp/libomptarget/test/api/omp_device_memory.c


Index: openmp/libomptarget/test/api/omp_device_memory.c
===================================================================
--- openmp/libomptarget/test/api/omp_device_memory.c
+++ openmp/libomptarget/test/api/omp_device_memory.c
@@ -1,5 +1,4 @@
-// RUN: %libomptarget-compile-run-and-check-nvptx64-nvidia-cuda
-// REQUIRES: nvptx64-nvidia-cuda
+// RUN: %libomptarget-compile-run-and-check-generic
 
 #include <omp.h>
 #include <stdio.h>
Index: openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
===================================================================
--- openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
+++ openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
@@ -2623,6 +2623,7 @@
   hsa_amd_memory_pool_t MemoryPool;
   switch (Kind) {
   case TARGET_ALLOC_DEFAULT:
+  case TARGET_ALLOC_DEVICE:
     // GPU memory
     MemoryPool = DeviceInfo().getDeviceMemoryPool(DeviceId);
     break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133128.457318.patch
Type: text/x-patch
Size: 892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220901/6c536040/attachment.bin>


More information about the Openmp-commits mailing list