kfdtest: Implement an infracture to support kfdtest run on multi gpu

Update class KFDBaseComponentTest to have kfdtest run on multi gpu under google test framework.

Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: If139c4fc6cf062fb800ff171c69cbf9604f98278
This commit is contained in:
Xiaogang Chen
2024-12-13 02:03:54 -06:00
committed by Xiaogang Chen
parent 665e6f80bf
commit b4943d718b
4 changed files with 254 additions and 9 deletions
@@ -626,6 +626,18 @@ const HsaNodeProperties* HsaNodeInfo::GetNodeProperties(int NodeNum) const {
return m_HsaNodeProps.at(NodeNum);
}
const int HsaNodeInfo::HsaGPUindexFromGpuNode(int gpuNodeId) const {
if (m_NodesWithGPU.size() == 0)
return -1;
for (unsigned int i = 0; i < m_NodesWithGPU.size(); i++) {
if (gpuNodeId == m_NodesWithGPU.at(i))
return i;
}
return -1;
}
const HsaNodeProperties* HsaNodeInfo::HsaDefaultGPUNodeProperties() const {
int NodeNum = HsaDefaultGPUNode();
if (NodeNum < 0)