From 5df1a8ae77a3987647ce4743d589b4c411c76ce3 Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Wed, 21 Aug 2019 16:52:26 -0500 Subject: [PATCH] Report PCIe domain number. Adds HSA_AMD_AGENT_INFO_DOMAIN. Change-Id: I2ffcae474e18b2fe5f962b499e02eb9dfe2e62cd [ROCm/ROCR-Runtime commit: f343f6706e678f18afb2cc30246694c863b86731] --- .../runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp | 3 +++ .../runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 3 +++ .../rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) 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 d97bebf736..582013aaa6 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 @@ -356,6 +356,9 @@ hsa_status_t CpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { case HSA_AMD_AGENT_INFO_HDP_FLUSH: *((hsa_amd_hdp_flush_t*)value) = {nullptr, nullptr}; break; + case HSA_AMD_AGENT_INFO_DOMAIN: + *((uint32_t*)value) = static_cast(properties_.Domain); + 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 9b79a6bbb9..0704c88401 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 @@ -906,6 +906,9 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { case HSA_AMD_AGENT_INFO_HDP_FLUSH: *((hsa_amd_hdp_flush_t*)value) = HDP_flush_; break; + case HSA_AMD_AGENT_INFO_DOMAIN: + *((uint32_t*)value) = static_cast(properties_.Domain); + 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 40505c3420..62ecf16f9d 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 @@ -152,7 +152,13 @@ typedef enum hsa_amd_agent_info_s { * model and should be treated with caution. * The type of this attribute is hsa_amd_hdp_flush_t. */ - HSA_AMD_AGENT_INFO_HDP_FLUSH = 0xA00E + HSA_AMD_AGENT_INFO_HDP_FLUSH = 0xA00E, + /** + * PCIe domain for the agent. Pairs with HSA_AMD_AGENT_INFO_BDFID + * to give the full physical location of the Agent. + * The type of this attribute is uint32_t. + */ + HSA_AMD_AGENT_INFO_DOMAIN = 0xA00F } hsa_amd_agent_info_t; typedef struct hsa_amd_hdp_flush_s {