diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp --- a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp +++ b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp @@ -1485,6 +1485,12 @@ return *FineGrainedMemoryPools[0]; } + AMDGPUMemoryPoolTy &getCoarseGrainedMemoryPool() { + assert(!CoarseGrainedMemoryPools.empty() && "No coarse-grained mempool"); + // Retrive any memory pool. + return *CoarseGrainedMemoryPools[0]; + } + /// Get a memory pool for kernel args allocations. AMDGPUMemoryPoolTy &getArgsMemoryPool() { assert(!ArgsMemoryPools.empty() && "No kernelargs mempool"); @@ -1762,6 +1768,7 @@ MemoryPool = CoarseGrainedMemoryPools[0]; break; case TARGET_ALLOC_HOST: + MemoryPool = &HostDevice.getFineGrainedMemoryPool(); break; case TARGET_ALLOC_SHARED: MemoryPool = &HostDevice.getFineGrainedMemoryPool(); @@ -2623,6 +2630,7 @@ MemoryPool = CoarseGrainedMemoryPools[0]; break; case TARGET_ALLOC_HOST: + MemoryPool = &HostDevice.getFineGrainedMemoryPool(); break; case TARGET_ALLOC_SHARED: MemoryPool = &HostDevice.getFineGrainedMemoryPool(); diff --git a/openmp/libomptarget/test/api/omp_host_pinned_memory.c b/openmp/libomptarget/test/api/omp_host_pinned_memory.c --- a/openmp/libomptarget/test/api/omp_host_pinned_memory.c +++ b/openmp/libomptarget/test/api/omp_host_pinned_memory.c @@ -1,5 +1,4 @@ // RUN: %libomptarget-compile-run-and-check-generic -// UNSUPPORTED: amdgcn-amd-amdhsa #include #include diff --git a/openmp/libomptarget/test/api/omp_host_pinned_memory_alloc.c b/openmp/libomptarget/test/api/omp_host_pinned_memory_alloc.c --- a/openmp/libomptarget/test/api/omp_host_pinned_memory_alloc.c +++ b/openmp/libomptarget/test/api/omp_host_pinned_memory_alloc.c @@ -1,5 +1,4 @@ // RUN: %libomptarget-compile-run-and-check-generic -// UNSUPPORTED: amdgcn-amd-amdhsa #include #include @@ -20,7 +19,7 @@ for (int i = 0; i < N; ++i) sum += hst_ptr[i]; - omp_free(hst_ptr, llvm_omp_target_shared_mem_alloc); + omp_free(hst_ptr, llvm_omp_target_host_mem_alloc); // CHECK: PASS if (sum == N) printf("PASS\n");