Correct size of SVM node array.

Was size of the map.  Needs to be size of the node id range.

Change-Id: I92501ea7adca5c30dbb0fdabd2c421dea58f8d6f


[ROCm/ROCR-Runtime commit: c9eb85e205]
This commit is contained in:
Sean Keely
2021-11-10 21:23:42 -06:00
rodzic 847df17afe
commit 0ed7eac560
2 zmienionych plików z 4 dodań i 1 usunięć
@@ -487,6 +487,9 @@ class Runtime {
/// @brief Get most recently issued SVM prefetch agent for the range in question.
Agent* GetSVMPrefetchAgent(void* ptr, size_t size);
/// @brief Get the highest used node id.
uint32_t max_node_id() const { return agents_by_node_.rbegin()->first; }
// Mutex object to protect multithreaded access to ::allocation_map_,
// KFD map/unmap, register/unregister, and access to hsaKmtQueryPointerInfo
// registered & mapped arrays.
@@ -1646,7 +1646,7 @@ hsa_status_t Runtime::SetSvmAttrib(void* ptr, size_t size,
hsa_amd_svm_attribute_pair_t* attribute_list,
size_t attribute_count) {
uint32_t set_attribs = 0;
std::vector<bool> agent_seen(agents_by_node_.size(), false);
std::vector<bool> agent_seen(max_node_id() + 1, false);
std::vector<HSA_SVM_ATTRIBUTE> attribs;
attribs.reserve(attribute_count);