Add experimental option to force discovery of all copy agents.

Discards all user provided async copy agent info and relies on
pointer info discovery.

Change-Id: Ife3e708a49ffccbede4983ab47d5ed0032970857
This commit is contained in:
Sean Keely
2022-04-29 16:35:49 -05:00
parent 13a0cdfa77
commit 3ebe99f96d
2 changed files with 13 additions and 6 deletions
+7 -6
View File
@@ -469,8 +469,9 @@ hsa_status_t Runtime::CopyMemory(void* dst, core::Agent* dst_agent, const void*
core::Agent* src_agent, size_t size,
std::vector<core::Signal*>& dep_signals,
core::Signal& completion_signal) {
auto lookupAgent = [this](core::Agent* agent, const void* ptr) {
if (agent == nullptr) {
if (agent == nullptr || flag().discover_copy_agents()) {
hsa_amd_pointer_info_t info;
PtrInfoBlockData block;
info.size = sizeof(info);
@@ -628,11 +629,11 @@ hsa_status_t Runtime::GetSystemInfo(hsa_system_info_t attribute, void* value) {
break;
}
case HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED: {
bool ret = true;
for (auto agent : gpu_agents_) {
AMD::GpuAgent* gpu = (AMD::GpuAgent*)agent;
ret &= (gpu->properties().Capability.ui32.SVMAPISupported == 1);
}
bool ret = true;
for (auto agent : gpu_agents_) {
AMD::GpuAgent* gpu = (AMD::GpuAgent*)agent;
ret &= (gpu->properties().Capability.ui32.SVMAPISupported == 1);
}
*(bool*)value = ret;
break;
}