diff --git a/runtime/hsa-runtime/core/inc/amd_gpu_agent.h b/runtime/hsa-runtime/core/inc/amd_gpu_agent.h index 6b4267522e..1ccb5a0bb3 100644 --- a/runtime/hsa-runtime/core/inc/amd_gpu_agent.h +++ b/runtime/hsa-runtime/core/inc/amd_gpu_agent.h @@ -329,6 +329,9 @@ class GpuAgent : public GpuAgentInt { // GPU devices. __forceinline uint32_t enumeration_index() const { return enum_index_; } + // @brief returns true if agent uses MES scheduler + __forceinline const bool isMES() const { return (isa_->GetMajorVersion() >= 11) ? true : false; }; + void Trim() override; const std::function& diff --git a/runtime/hsa-runtime/core/inc/queue.h b/runtime/hsa-runtime/core/inc/queue.h index 1f631fab11..fd43b16fad 100644 --- a/runtime/hsa-runtime/core/inc/queue.h +++ b/runtime/hsa-runtime/core/inc/queue.h @@ -127,7 +127,7 @@ struct SharedQueue { class LocalQueue { public: - LocalQueue() : local_queue_(MemoryRegion::AllocateNonPaged) {} + LocalQueue(int mem_flags) : local_queue_(mem_flags) {} SharedQueue* queue() const { return local_queue_.shared_object(); } private: @@ -144,7 +144,7 @@ All funtions other than Convert and public_handle must be virtual. */ class Queue : public Checked<0xFA3906A679F9DB49>, private LocalQueue { public: - Queue() : LocalQueue(), amd_queue_(queue()->amd_queue) { + Queue(int mem_flags = 0) : LocalQueue(mem_flags), amd_queue_(queue()->amd_queue) { queue()->core_queue = this; public_handle_ = Convert(this); } diff --git a/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp b/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp index 921c46a3c9..a9a2cac75b 100644 --- a/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp @@ -80,7 +80,7 @@ int AqlQueue::rtti_id_ = 0; AqlQueue::AqlQueue(GpuAgent* agent, size_t req_size_pkts, HSAuint32 node_id, ScratchInfo& scratch, core::HsaEventCallback callback, void* err_data, bool is_kv) - : Queue(), + : Queue(agent->isMES() ? MemoryRegion::AllocateNonPaged : 0), LocalSignal(0, false), DoorbellSignal(signal()), ring_buf_(nullptr),