From 03bd4c95089cded4f00590ed906c782a374bb350 Mon Sep 17 00:00:00 2001 From: Yiannis Papadopoulos Date: Thu, 9 Jan 2025 16:05:48 -0500 Subject: [PATCH] rocr: Changing to a device SVM flag Change-Id: Ib085801d23604eeef0a17a05cf2b298170fb3d24 --- runtime/hsa-runtime/core/driver/xdna/amd_xdna_driver.cpp | 2 +- runtime/hsa-runtime/core/inc/amd_memory_region.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/hsa-runtime/core/driver/xdna/amd_xdna_driver.cpp b/runtime/hsa-runtime/core/driver/xdna/amd_xdna_driver.cpp index f5d16f7729..60325b7f53 100644 --- a/runtime/hsa-runtime/core/driver/xdna/amd_xdna_driver.cpp +++ b/runtime/hsa-runtime/core/driver/xdna/amd_xdna_driver.cpp @@ -198,7 +198,7 @@ XdnaDriver::AllocateMemory(const core::MemoryRegion &mem_region, return HSA_STATUS_ERROR_INVALID_REGION; } - const bool use_bo_shmem = m_region.kernarg() || m_region.IsSystemButNotSVM(); + const bool use_bo_shmem = !m_region.IsDeviceSVM(); if (use_bo_shmem) { create_bo_args.type = AMDXDNA_BO_SHMEM; } else { diff --git a/runtime/hsa-runtime/core/inc/amd_memory_region.h b/runtime/hsa-runtime/core/inc/amd_memory_region.h index 53f69912da..79f6631550 100644 --- a/runtime/hsa-runtime/core/inc/amd_memory_region.h +++ b/runtime/hsa-runtime/core/inc/amd_memory_region.h @@ -147,8 +147,8 @@ class MemoryRegion : public core::MemoryRegion { (mem_props_.HeapType == HSA_HEAPTYPE_DEVICE_SVM)); } - __forceinline bool IsSystemButNotSVM() const { - return (mem_props_.HeapType == HSA_HEAPTYPE_SYSTEM); + __forceinline bool IsDeviceSVM() const { + return (mem_props_.HeapType == HSA_HEAPTYPE_DEVICE_SVM); } __forceinline bool IsLDS() const {