Add memory pool query to return location

Change-Id: I240b77119d7b8ccfc5ff6a3190d6669d69f243e8
This commit is contained in:
David Yat Sin
2023-01-10 15:08:51 +00:00
parent a4f898ad15
commit 722794e258
2 changed files with 25 additions and 0 deletions
@@ -420,6 +420,14 @@ hsa_status_t MemoryRegion::GetPoolInfo(hsa_amd_memory_pool_info_t attribute,
*((size_t*)value) = 0;
}
break;
case HSA_AMD_MEMORY_POOL_INFO_LOCATION:
if (IsLocalMemory())
*((hsa_amd_memory_pool_location_t*)value) = HSA_AMD_MEMORY_POOL_LOCATION_GPU;
else if (IsSystem())
*((hsa_amd_memory_pool_location_t*)value) = HSA_AMD_MEMORY_POOL_LOCATION_CPU;
else
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
break;
default:
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
}