ROCr changes to enable small BAR P2P over xGMI

Change-Id: I6aaa3fe2565cdf7e15d58a7484d6bd5916ffff64
Этот коммит содержится в:
Ramesh Errabolu
2018-08-28 16:20:03 -05:00
родитель 81532bb6f5
Коммит f007870792
4 изменённых файлов: 17 добавлений и 9 удалений
+2 -2
Просмотреть файл
@@ -408,7 +408,7 @@ hsa_status_t MemoryRegion::GetAgentPoolInfo(
((IsSystem() && (agent.device_type() == core::Agent::kAmdCpuDevice)) ||
(agent.node_id() == owner()->node_id()))
? HSA_AMD_MEMORY_POOL_ACCESS_ALLOWED_BY_DEFAULT
: (IsSystem() || (IsPublic() && link_info.num_hop > 0))
: (IsSystem() || (IsLocalMemory() && link_info.num_hop > 0))
? HSA_AMD_MEMORY_POOL_ACCESS_DISALLOWED_BY_DEFAULT
: HSA_AMD_MEMORY_POOL_ACCESS_NEVER_ALLOWED;
@@ -502,7 +502,7 @@ hsa_status_t MemoryRegion::AllowAccess(uint32_t num_agents,
// If this is a local memory region, the owning gpu always needs to be in
// the whitelist.
if (IsPublic() &&
if (IsLocalMemory() &&
std::find(whitelist_nodes.begin(), whitelist_nodes.end(), owner()->node_id()) ==
whitelist_nodes.end()) {
whitelist_nodes.push_back(owner()->node_id());
+6
Просмотреть файл
@@ -120,6 +120,12 @@ void RegisterLinkInfo(uint32_t node_id, uint32_t num_link) {
link_info.link_type = HSA_AMD_LINK_INFO_TYPE_INFINBAND;
debug_print("IOLINK is missing atomic and coherency defaults.\n");
break;
case HSA_IOLINK_TYPE_XGMI:
link_info.link_type = HSA_AMD_LINK_INFO_TYPE_XGMI;
link_info.atomic_support_32bit = true;
link_info.atomic_support_64bit = true;
link_info.coherent_support = true;
break;
default:
debug_print("Unrecognized IOLINK type.\n");
break;
+3 -6
Просмотреть файл
@@ -252,9 +252,8 @@ void Runtime::DestroyAgents() {
system_regions_coarse_.clear();
}
void Runtime::SetLinkCount(size_t num_link) {
const size_t last_index = GetIndexLinkInfo(0, num_link);
link_matrix_.resize(last_index);
void Runtime::SetLinkCount(size_t num_nodes) {
link_matrix_.resize(num_nodes * num_nodes);
}
void Runtime::RegisterLinkInfo(uint32_t node_id_from, uint32_t node_id_to,
@@ -277,9 +276,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) {
const uint32_t node_id_max = std::max(node_id_from, node_id_to) - 1;
const uint32_t node_id_min = std::min(node_id_from, node_id_to);
return ((node_id_max * (node_id_max + 1) / 2) + node_id_min);
return ((node_id_from * agents_by_node_.size()) + node_id_to);
}
hsa_status_t Runtime::IterateAgent(hsa_status_t (*callback)(hsa_agent_t agent,
+6 -1
Просмотреть файл
@@ -962,7 +962,12 @@ typedef enum {
/**
* Infiniband bus type.
*/
HSA_AMD_LINK_INFO_TYPE_INFINBAND = 3
HSA_AMD_LINK_INFO_TYPE_INFINBAND = 3,
/**
* xGMI link type.
*/
HSA_AMD_LINK_INFO_TYPE_XGMI = 4
} hsa_amd_link_info_type_t;