kfdtest: Include SDMA queue info in class KFDBaseComponentTest

This will facilitate us to avoid using family ID to differentiate the
SDMA engines and SDMA queues.

Change-Id: I8d6203cc5d330e9130a1b2624997c86ba53e8ae4
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
This commit is contained in:
Yong Zhao
2019-01-09 19:20:32 -05:00
parent 51ee5c324a
commit 6857602cbc
4 changed files with 31 additions and 1 deletions
@@ -63,6 +63,8 @@ void KFDBaseComponentTest::SetUp() {
g_TestGPUFamilyId = FamilyIdFromNode(nodeProperties);
GetSdmaInfo(nodeProperties, &m_numSdmaEngines, &m_numSdmaQueuesPerEngine);
m_FamilyId = g_TestGPUFamilyId;
ROUTINE_END
@@ -60,6 +60,8 @@ class KFDBaseComponentTest : public testing::Test {
HsaVersionInfo m_VersionInfo;
HsaSystemProperties m_SystemProperties;
unsigned int m_FamilyId;
unsigned int m_numSdmaEngines;
unsigned int m_numSdmaQueuesPerEngine;
HsaMemFlags m_MemoryFlags;
HsaNodeInfo m_NodeInfo;
+23
View File
@@ -126,6 +126,29 @@ unsigned int FamilyIdFromNode(const HsaNodeProperties *props) {
return familyId;
}
void GetSdmaInfo(const HsaNodeProperties *props,
unsigned int *p_num_sdma_engines,
unsigned int *p_num_sdma_queues_per_engine) {
int num_sdma_engines = 2;
int num_sdma_queues_per_engine = 2;
switch (props->EngineId.ui32.Major) {
case 9:
if (props->EngineId.ui32.Stepping == 2) // RAVEN
num_sdma_engines = 1;
else if (props->EngineId.ui32.Stepping == 6) // VEGA20
num_sdma_queues_per_engine = 8;
break;
}
if (p_num_sdma_engines)
*p_num_sdma_engines = num_sdma_engines;
if (p_num_sdma_queues_per_engine)
*p_num_sdma_queues_per_engine = num_sdma_queues_per_engine;
}
bool isTonga(const HsaNodeProperties *props) {
/* Tonga has some workarounds in the thunk that cause certain failures */
if (props->EngineId.ui32.Major == 8 && props->EngineId.ui32.Stepping == 2) {
+4 -1
View File
@@ -48,8 +48,11 @@ HSAKMT_STATUS CreateQueueTypeEvent(bool ManualReset, bool IsSignaled, unsigned i
bool is_dgpu();
bool isTonga(const HsaNodeProperties *props);
unsigned int FamilyIdFromNode(const HsaNodeProperties * props);
unsigned int FamilyIdFromNode(const HsaNodeProperties *props);
void GetSdmaInfo(const HsaNodeProperties *props,
unsigned int *p_num_sdma_engines,
unsigned int *p_num_sdma_queues_per_engine);
class HsaMemoryBuffer {
public: