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 <lang.yu@amd.com>
Signed-off-by: Chris Freehill <cfreehil@amd.com>


[ROCm/ROCR-Runtime commit: 7e6c3d1bfa]
Этот коммит содержится в:
Lang Yu
2024-06-20 04:49:57 -04:00
коммит произвёл Chris Freehill
родитель 55761ca4a5
Коммит f2f5585a73
+3 -2
Просмотреть файл
@@ -311,9 +311,10 @@ void MemoryAtomic::MemoryAtomicTest(hsa_agent_t cpuAgent,
err = hsa_amd_memory_pool_allocate(gpu_pool, kMemoryAllocSize, 0,
reinterpret_cast<void **>(&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<void **>(&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;
}