Fix query HSA_AMD_AGENT_MEMORY_POOL_INFO_LINK_INFO

Querying HSA_AMD_AGENT_MEMORY_POOL_INFO_LINK_INFO between a gpu agent
and its own local memory pool returns a wrong information.
Fix: return link with 0 hop count.

[git-p4: depot-paths = "//depot/stg/hsa/drivers/hsa/runtime/": change = 1257544]


[ROCm/ROCR-Runtime commit: 5a584fa1ab]
이 커밋은 다음에 포함됨:
Besar Wicaksono (xN/A) TX [TEXT]
2016-04-13 12:39:25 -05:00
부모 56f5e65938
커밋 4b44183941
2개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
+3 -1
파일 보기
@@ -87,6 +87,8 @@ class Runtime {
public:
/// @brief Structure to describe connectivity between agents.
struct LinkInfo {
LinkInfo() : num_hop(0), info{0} {}
uint32_t num_hop;
hsa_amd_memory_pool_link_info_t info;
};
@@ -133,7 +135,7 @@ class Runtime {
/// @param [in] node_id_from Node id of the source node.
/// @param [in] node_id_to Node id of the destination node.
/// @retval The link information between source and destination nodes.
const LinkInfo& GetLinkInfo(uint32_t node_id_from, uint32_t node_id_to);
const LinkInfo GetLinkInfo(uint32_t node_id_from, uint32_t node_id_to);
/// @brief Invoke the user provided call back for each agent in the agent
/// list.
+5 -3
파일 보기
@@ -263,9 +263,11 @@ void Runtime::RegisterLinkInfo(uint32_t node_id_from, uint32_t node_id_to,
link_matrix_[idx].info = link_info;
}
const Runtime::LinkInfo& Runtime::GetLinkInfo(uint32_t node_id_from,
uint32_t node_id_to) {
return link_matrix_[GetIndexLinkInfo(node_id_from, node_id_to)];
const Runtime::LinkInfo Runtime::GetLinkInfo(uint32_t node_id_from,
uint32_t node_id_to) {
return (node_id_from != node_id_to)
? link_matrix_[GetIndexLinkInfo(node_id_from, node_id_to)]
: LinkInfo(); // No link.
}
uint32_t Runtime::GetIndexLinkInfo(uint32_t node_id_from, uint32_t node_id_to) {