From f77c754281956a243fed17823f28c1fdb70bf6f0 Mon Sep 17 00:00:00 2001 From: Oak Zeng Date: Wed, 13 Feb 2019 10:22:32 -0600 Subject: [PATCH] Thunk interface to get SDMA engine info Add SDMA engine info fields to node properties and modify get node properties API to read SDMA engine info from sysfs Change-Id: Iea877b5bc008cc9df9405daf564a359535f1bc9f Signed-off-by: Oak Zeng [ROCm/ROCR-Runtime commit: 414a3508d6ee7fa301ee1ca9ef0587c7e0c4d146] --- projects/rocr-runtime/include/hsakmttypes.h | 4 +++- projects/rocr-runtime/src/topology.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/include/hsakmttypes.h b/projects/rocr-runtime/include/hsakmttypes.h index 210f4fc523..f74641d181 100644 --- a/projects/rocr-runtime/include/hsakmttypes.h +++ b/projects/rocr-runtime/include/hsakmttypes.h @@ -299,7 +299,9 @@ typedef struct _HsaNodeProperties HSA_DEBUG_PROPERTIES DebugProperties; // Debug properties of this node. HSAuint64 HiveID; // XGMI Hive the GPU node belongs to in the system. It is an opaque and static // number hash created by the PSP - HSAuint8 Reserved[44]; + HSAuint32 NumSdmaEngines; // number of PCIe optimized SDMA engines + HSAuint32 NumSdmaXgmiEngines;// number of XGMI optimized SDMA engines + HSAuint8 Reserved[36]; } HsaNodeProperties; diff --git a/projects/rocr-runtime/src/topology.c b/projects/rocr-runtime/src/topology.c index 31f9797d09..4e3290c7ea 100644 --- a/projects/rocr-runtime/src/topology.c +++ b/projects/rocr-runtime/src/topology.c @@ -990,6 +990,10 @@ HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id, props->uCodeEngineVersions.Value = (uint32_t)prop_val & 0x3ff; else if (strcmp(prop_name, "hive_id") == 0) props->HiveID = prop_val; + else if (strcmp(prop_name, "num_sdma_engines") == 0) + props->NumSdmaEngines = prop_val; + else if (strcmp(prop_name, "num_sdma_xgmi_engines") == 0) + props->NumSdmaXgmiEngines = prop_val; } hsa_gfxip = find_hsa_gfxip_device(props->DeviceId);