From 742dcd8c5828b8a5b67fcc4f97c406c6d988c291 Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Mon, 28 Mar 2022 15:48:09 -0400 Subject: [PATCH] kfdtest: Check for Atomic Ops support before running Atomics test If PCIe Atomics aren't supported, we shouldn't try to run a test that tests PCIe Atomics. Check for support, and bail early if it's not there Signed-off-by: Kent Russell Change-Id: Ie9aa0fed3ece07fb83a33e6cacef2961626afab4 [ROCm/ROCR-Runtime commit: f62e9b9821d8ad402be1f1c1a59f9e7942cb4c1b] --- .../rocr-runtime/tests/kfdtest/src/KFDQMTest.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/rocr-runtime/tests/kfdtest/src/KFDQMTest.cpp b/projects/rocr-runtime/tests/kfdtest/src/KFDQMTest.cpp index 6d4cb7cbef..9b4003b68e 100644 --- a/projects/rocr-runtime/tests/kfdtest/src/KFDQMTest.cpp +++ b/projects/rocr-runtime/tests/kfdtest/src/KFDQMTest.cpp @@ -1518,13 +1518,15 @@ unsigned int AtomicIncThread(void* pCtx) { TEST_F(KFDQMTest, Atomics) { TEST_START(TESTPROFILE_RUNALL); - /* CI doesn't support Atomics. KV does, but gets its own FAMILY_KV def */ - if (m_FamilyId == FAMILY_CI) { - LOG() << "Skipping test: CI doesn't support Atomics." << std::endl; + + int defaultGPUNode = m_NodeInfo.HsaDefaultGPUNode(); + + ASSERT_GE(defaultGPUNode, 0) << "failed to get default GPU Node"; + + if (!hasPciAtomicsSupport(defaultGPUNode)) { + LOG() << "Skipping test: Node doesn't support Atomics." << std::endl; return; } - int defaultGPUNode = m_NodeInfo.HsaDefaultGPUNode(); - ASSERT_GE(defaultGPUNode, 0) << "failed to get default GPU Node"; HsaMemoryBuffer isaBuf(PAGE_SIZE, defaultGPUNode, true/*zero*/, false/*local*/, true/*exec*/); HsaMemoryBuffer destBuf(PAGE_SIZE, defaultGPUNode);