Add query for IOMMU support

Reporting whether IOMMU V2 is supported.
IOMMU V1 support is not relevant to user, so not reporting it.

Change-Id: I77389484a87a352da9c2f7b2a5d9de264f90ee53


[ROCm/ROCR-Runtime commit: e30be76f37]
Tá an tiomantas seo le fáil i:
David Yat Sin
2023-01-17 21:14:09 +00:00
tuismitheoir 580ce4fd25
tiomantas 8a86cddd3a
D'athraigh 3 comhad le 30 breiseanna agus 2 scriosta
@@ -376,6 +376,9 @@ hsa_status_t CpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const {
case HSA_AMD_AGENT_INFO_SDMA_UCODE_VERSION:
*((uint32_t*)value) = 0;
break;
case HSA_AMD_AGENT_INFO_IOMMU_SUPPORT:
*((hsa_amd_iommu_version_t*)value) = HSA_IOMMU_SUPPORT_NONE;
break;
default:
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
break;
@@ -1111,6 +1111,12 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const {
case HSA_AMD_AGENT_INFO_SDMA_UCODE_VERSION:
*((uint32_t*)value) = static_cast<uint32_t>(properties_.uCodeEngineVersions.uCodeSDMA);
break;
case HSA_AMD_AGENT_INFO_IOMMU_SUPPORT:
if (properties_.Capability.ui32.HSAMMUPresent)
*((hsa_amd_iommu_version_t*)value) = HSA_IOMMU_SUPPORT_V2;
else
*((hsa_amd_iommu_version_t*)value) = HSA_IOMMU_SUPPORT_NONE;
break;
default:
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
break;