From 2f73db8fb05fe8f96c82964734496c056234f16d Mon Sep 17 00:00:00 2001 From: Graham Sider Date: Fri, 24 Sep 2021 18:49:02 -0400 Subject: [PATCH] kfdtest: Add GetGfxVersion to KFDTestUtil Required to derive LLVM AMDGPU target ASIC (MCPU). Signed-off-by: Graham Sider Change-Id: If8f139b3858c9bf42feba23ae9210e14625dc08b --- tests/kfdtest/src/KFDTestUtil.cpp | 6 ++++++ tests/kfdtest/src/KFDTestUtil.hpp | 1 + 2 files changed, 7 insertions(+) diff --git a/tests/kfdtest/src/KFDTestUtil.cpp b/tests/kfdtest/src/KFDTestUtil.cpp index 476e0bb1ce..2eddc8857b 100644 --- a/tests/kfdtest/src/KFDTestUtil.cpp +++ b/tests/kfdtest/src/KFDTestUtil.cpp @@ -231,6 +231,12 @@ bool isTonga(const HsaNodeProperties *props) { return false; } +const uint32_t GetGfxVersion(const HsaNodeProperties *props) { + return ((props->EngineId.ui32.Major << 16) | + (props->EngineId.ui32.Minor << 8) | + (props->EngineId.ui32.Stepping)); +} + HSAuint64 GetSystemTickCountInMicroSec() { struct timeval t; gettimeofday(&t, 0); diff --git a/tests/kfdtest/src/KFDTestUtil.hpp b/tests/kfdtest/src/KFDTestUtil.hpp index 7c2f9c61ce..938ff8bf69 100644 --- a/tests/kfdtest/src/KFDTestUtil.hpp +++ b/tests/kfdtest/src/KFDTestUtil.hpp @@ -52,6 +52,7 @@ bool is_dgpu(); bool isTonga(const HsaNodeProperties *props); bool hasPciAtomicsSupport(int node); unsigned int FamilyIdFromNode(const HsaNodeProperties *props); +const uint32_t GetGfxVersion(const HsaNodeProperties *props); void GetHwQueueInfo(const HsaNodeProperties *props, unsigned int *p_num_cp_queues,