diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/common/shared.h b/projects/rocr-runtime/runtime/hsa-runtime/core/common/shared.h index 5b1298a4fd..47000d4d5d 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/common/shared.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/common/shared.h @@ -141,10 +141,10 @@ class Shared final : private BaseShared { template class Shared> final : private BaseShared { public: - Shared() { + Shared(int flags = 0) { assert(allocate_ != nullptr && free_ != nullptr && "Shared object allocator is not set"); - shared_object_ = PageAllocator::alloc(); + shared_object_ = PageAllocator::alloc(flags); } ~Shared() { diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/memory_region.h b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/memory_region.h index 30fbc07ac1..48ecb3dcdc 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/memory_region.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/memory_region.h @@ -89,6 +89,7 @@ class MemoryRegion : public Checked<0x9C961F19EE175BB3> { AllocateDoubleMap = (1 << 2), // Map twice VA allocation to backing store AllocateDirect = (1 << 3), // Bypass fragment cache. AllocateIPC = (1 << 4), // System memory that can be IPC-shared + AllocateNonPaged = (1 << 4), // Non-paged system memory (AllocateIPC alias) AllocatePCIeRW = (1 << 5), // Enforce pseudo fine grain/RW memory }; diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/queue.h b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/queue.h index bfe6c8bb2c..1f631fab11 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/queue.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/queue.h @@ -49,6 +49,7 @@ #include "core/common/shared.h" #include "core/inc/checked.h" +#include "core/inc/memory_region.h" #include "core/util/utils.h" #include "inc/amd_hsa_queue.h" @@ -126,6 +127,7 @@ struct SharedQueue { class LocalQueue { public: + LocalQueue() : local_queue_(MemoryRegion::AllocateNonPaged) {} SharedQueue* queue() const { return local_queue_.shared_object(); } private: diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp index 8327dec6cb..a27e90eada 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp @@ -185,7 +185,7 @@ hsa_status_t MemoryRegion::AllocateImpl(size_t& size, AllocateFlags alloc_flags, (alloc_flags & AllocateExecutable ? 1 : 0); kmt_alloc_flags.ui32.AQLQueueMemory = (alloc_flags & AllocateDoubleMap ? 1 : 0); - if (IsSystem() && (alloc_flags & AllocateIPC)) + if (IsSystem() && (alloc_flags & AllocateNonPaged)) kmt_alloc_flags.ui32.NonPaged = 1; // Allocate pseudo fine grain memory