rocr/vmm: Only modify permisions for specified agents

When hsa_amd_vmem_set_access is called, do not remove permissions for
unspecified agents. Also updating documentation in header to clarify
this.

Change-Id: I3bb4cf08ba399f85cc67b17fd13a4a40d862415f
このコミットが含まれているのは:
David Yat Sin
2024-09-27 18:19:53 +00:00
コミット 73f6bfa747
2個のファイルの変更3行の追加26行の削除
-24
ファイルの表示
@@ -3388,30 +3388,6 @@ Runtime::VMemorySetAccessPerHandle(void *va, MappedHandle &mappedHandle,
}
}
}
// Remove agents that were previously allowed but not included in current list
for (auto agentPermsIt = mappedHandle.allowed_agents.begin();
agentPermsIt != mappedHandle.allowed_agents.end();) {
bool agent_removed = true;
for (int i = 0; i < desc_cnt; i++) {
Agent *checkAgent = Agent::Convert(desc[i].agent_handle);
if (agentPermsIt->first == checkAgent) {
agent_removed = false;
break;
}
}
if (agent_removed) {
if (agentPermsIt->second.RemoveAccess() != HSA_STATUS_SUCCESS)
throw AMD::hsa_exception(HSA_STATUS_ERROR, "Failed to remove access for memory handle.");
agentPermsIt = mappedHandle.allowed_agents.erase(agentPermsIt);
} else {
++agentPermsIt;
}
}
return HSA_STATUS_SUCCESS;
}