From f2f5585a73418c5a3f369893bb188fceb65fdfde Mon Sep 17 00:00:00 2001 From: Lang Yu Date: Thu, 20 Jun 2024 04:49:57 -0400 Subject: [PATCH] Fix Memory_Atomic_Add_Test issue Since "libhsakmt: Prevent hsaKmtRegisterMemory* from registering non-userptr", non-userptr is not allowed to be pinned any more. Use hsa_amd_agents_allow_access to map host memory. Change-Id: I898d2f83222907de58cafc1a2b18a636634d1b20 Signed-off-by: Lang Yu Signed-off-by: Chris Freehill [ROCm/ROCR-Runtime commit: 7e6c3d1bfaf4a52de6c4821e87dc6cc554210ee3] --- .../rocr-runtime/rocrtst/suites/functional/memory_atomics.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/rocr-runtime/rocrtst/suites/functional/memory_atomics.cc b/projects/rocr-runtime/rocrtst/suites/functional/memory_atomics.cc index 95390e6e90..0739f1bd69 100755 --- a/projects/rocr-runtime/rocrtst/suites/functional/memory_atomics.cc +++ b/projects/rocr-runtime/rocrtst/suites/functional/memory_atomics.cc @@ -311,9 +311,10 @@ void MemoryAtomic::MemoryAtomicTest(hsa_agent_t cpuAgent, err = hsa_amd_memory_pool_allocate(gpu_pool, kMemoryAllocSize, 0, reinterpret_cast(&g_gpuRefData)); ASSERT_EQ(err, HSA_STATUS_SUCCESS); - // Pinned the Host memory and get the pointer to new adress which is accesible to GPU agent - err = hsa_amd_memory_lock(gpuRefData, kMemoryAllocSize, &gpuAgent, 1, reinterpret_cast(&device_ptr)); + // Map the Host memory and get the pointer to new adress which is accesible to GPU agent + err = hsa_amd_agents_allow_access(1, &gpuAgent, NULL, gpuRefData); ASSERT_EQ(err, HSA_STATUS_SUCCESS); + device_ptr = gpuRefData; }