kfdtest: add MES judging API in test utility.

Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Change-Id: I978fc85b7c81ea65b97953a50d2d0312bcba95bf


[ROCm/ROCR-Runtime commit: 564913526a]
This commit is contained in:
Yifan Zhang
2023-02-23 13:51:51 +08:00
کامیت شده توسط Yifan1 Zhang
والد b6467c7bc8
کامیت 8554f0df14
4فایلهای تغییر یافته به همراه12 افزوده شده و 0 حذف شده
@@ -164,6 +164,11 @@ unsigned int KFDBaseComponentTest::GetFamilyIdFromNodeId(unsigned int nodeId)
return FamilyIdFromNode(m_NodeInfo.GetNodeProperties(nodeId));
}
bool KFDBaseComponentTest::isMES(unsigned int nodeId)
{
return CheckMES(m_NodeInfo.GetNodeProperties(nodeId));
}
int KFDBaseComponentTest::FindDRMRenderNode(int gpuNode) {
HsaNodeProperties *nodeProperties;
_HSAKMT_STATUS status;
@@ -58,6 +58,7 @@ class KFDBaseComponentTest : public testing::Test {
// @return DRM Render Node if successful or -1 on failure
int FindDRMRenderNode(int gpuNode);
unsigned int GetFamilyIdFromNodeId(unsigned int nodeId);
bool isMES(unsigned int nodeId);
unsigned int GetFamilyIdFromDefaultNode(){ return m_FamilyId; }
// @brief Executed before the first test that uses KFDBaseComponentTest.
@@ -234,6 +234,11 @@ bool isTonga(const HsaNodeProperties *props) {
return false;
}
bool CheckMES(const HsaNodeProperties *props) {
/* MES devices need GART mappings and therefore need non-paged memory */
return (props->EngineId.ui32.Major >= 11) ? true : false;
}
const uint32_t GetGfxVersion(const HsaNodeProperties *props) {
return ((props->EngineId.ui32.Major << 16) |
(props->EngineId.ui32.Minor << 8) |
@@ -50,6 +50,7 @@ HSAKMT_STATUS CreateQueueTypeEvent(bool ManualReset, bool IsSignaled, unsigned i
bool is_dgpu();
bool isTonga(const HsaNodeProperties *props);
bool CheckMES(const HsaNodeProperties *props);
bool hasPciAtomicsSupport(int node);
unsigned int FamilyIdFromNode(const HsaNodeProperties *props);
const uint32_t GetGfxVersion(const HsaNodeProperties *props);