diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp index a271601365..2c4d236933 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp @@ -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; diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 4ba4d5d804..791f2b6430 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -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(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; diff --git a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h index a8f5fcfd2b..eff93710d4 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h @@ -200,6 +200,21 @@ enum { HSA_STATUS_CU_MASK_REDUCED = 44, }; +/** + * @brief IOMMU version supported + */ +typedef enum { + /** + * IOMMU not supported + */ + HSA_IOMMU_SUPPORT_NONE = 0, + /* IOMMU V1 support is not relevant to user applications, so not reporting it */ + /** + * IOMMU V2 supported + */ + HSA_IOMMU_SUPPORT_V2 = 1, +} hsa_amd_iommu_version_t; + /** * @brief Agent attributes. */ @@ -345,8 +360,12 @@ typedef enum hsa_amd_agent_info_s { * Queries for the SDMA engine ucode of an agent. * The type of this attribute is uint32_t. */ - HSA_AMD_AGENT_INFO_SDMA_UCODE_VERSION = 0xA109 - + HSA_AMD_AGENT_INFO_SDMA_UCODE_VERSION = 0xA109, + /** + * Queries for version of IOMMU supported by agent. + * The type of this attribute is hsa_amd_iommu_version_t. + */ + HSA_AMD_AGENT_INFO_IOMMU_SUPPORT = 0xA110 } hsa_amd_agent_info_t; typedef struct hsa_amd_hdp_flush_s {