rocr/aie: Support VMEM handle creation

Adds support for AllocateMemoryOnly inside XDNA driver.

Move the IsLocalMemory() check inside the KFD driver
since the XDNA driver can, and needs to, create handles
on system memory buffer objects.

Changed handle variable name from thunk_handle to user_mode_driver_handle,
which is more representative if we support non-GPU drivers.

Change-Id: I95db9d575afd1ab0ff2de74cea5175d9a12a721b


[ROCm/ROCR-Runtime commit: 4bf102dc6b]
This commit is contained in:
Tony Gutierrez
2024-08-19 15:52:43 +00:00
committed by David Yat Sin
parent f58a06c656
commit 29de0df770
4 changed files with 36 additions and 10 deletions
@@ -43,6 +43,7 @@
#define HSA_RUNTIME_CORE_INC_AMD_XDNA_DRIVER_H_
#include <memory>
#include <unordered_map>
#include "core/inc/driver.h"
#include "core/inc/memory_region.h"
@@ -89,6 +90,12 @@ private:
hsa_status_t InitDeviceHeap();
hsa_status_t FreeDeviceHeap();
/// TODO: Remove this in the future and rely on the core Runtime
/// object to track handle allocations. Using the VMEM API for mapping XDNA
/// driver handles requires a bit more refactoring. So rely on the XDNA driver
/// to manage some of this for now.
std::unordered_map<uint32_t, void *> vmem_handle_mappings;
/// @brief Virtual address range allocated for the device heap.
///
/// Allocate a large enough space so we can carve out the device heap in