diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/runtime.h b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/runtime.h index 9721f9c9a6..ffed796fdd 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/runtime.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/runtime.h @@ -504,6 +504,9 @@ class Runtime { // System clock frequency. uint64_t sys_clock_freq_; + // Number of Numa Nodes + size_t num_nodes_; + // @brief AMD HSA event to monitor for virtual memory access fault. HsaEvent* vm_fault_event_; diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index 9444edcc8f..410076b458 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -253,6 +253,7 @@ void Runtime::DestroyAgents() { } void Runtime::SetLinkCount(size_t num_nodes) { + num_nodes_ = num_nodes; link_matrix_.resize(num_nodes * num_nodes); } @@ -276,7 +277,7 @@ const Runtime::LinkInfo Runtime::GetLinkInfo(uint32_t node_id_from, } uint32_t Runtime::GetIndexLinkInfo(uint32_t node_id_from, uint32_t node_id_to) { - return ((node_id_from * agents_by_node_.size()) + node_id_to); + return ((node_id_from * num_nodes_) + node_id_to); } hsa_status_t Runtime::IterateAgent(hsa_status_t (*callback)(hsa_agent_t agent,