feature: add support for SIMD16 EU per DSS to xe-prelim helper

Related-To: NEO-12012
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-09-10 13:19:49 +00:00
committed by Compute-Runtime-Automation
parent 4f1262645b
commit dfbad8029b
10 changed files with 45 additions and 24 deletions

View File

@@ -11,7 +11,6 @@ set(NEO_CORE_OS_INTERFACE_LINUX_XE
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.h
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/ioctl_helper_xe_perf.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/ioctl_helper_xe_eu_dss.cpp
${CMAKE_CURRENT_SOURCE_DIR}/xedrm.h
${CMAKE_CURRENT_SOURCE_DIR}/xedrm_prelim.h
)

View File

@@ -1719,4 +1719,7 @@ void IoctlHelperXe::querySupportedFeatures() {
};
supportedFeatures.flags.pageFault = checkVmCreateFlagsSupport(DRM_XE_VM_CREATE_FLAG_LR_MODE | DRM_XE_VM_CREATE_FLAG_FAULT_MODE);
};
bool IoctlHelperXe::isEuPerDssTopologyType(uint16_t topologyType) const {
return topologyType == DRM_XE_TOPO_EU_PER_DSS;
}
} // namespace NEO

View File

@@ -133,6 +133,7 @@ class IoctlHelperXe : public IoctlHelper {
void registerBOBindHandle(Drm *drm, DrmAllocation *drmAllocation) override;
bool resourceRegistrationEnabled() override { return true; }
bool isPreemptionSupported() override { return true; }
virtual bool isEuPerDssTopologyType(uint16_t topologyType) const;
protected:
static constexpr uint32_t maxContextSetProperties = 4;
@@ -174,7 +175,6 @@ class IoctlHelperXe : public IoctlHelper {
uint16_t revision;
};
bool queryHwIpVersion(GtIpVersion &gtIpVersion);
static bool isEuPerDssTopologyType(uint16_t topologyType);
int maxExecQueuePriority = 0;
std::mutex xeLock;

View File

@@ -1,15 +0,0 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe.h"
#include "shared/source/os_interface/linux/xe/xedrm.h"
namespace NEO {
bool IoctlHelperXe::isEuPerDssTopologyType(uint16_t topologyType) {
return topologyType == DRM_XE_TOPO_EU_PER_DSS;
}
} // namespace NEO

View File

@@ -11,7 +11,8 @@
namespace NEO {
IoctlHelperXePrelim::~IoctlHelperXePrelim() {
xeLog("IoctlHelperXePrelim::~IoctlHelperXePrelim\n", "");
bool IoctlHelperXePrelim::isEuPerDssTopologyType(uint16_t topologyType) const {
return topologyType == DRM_XE_TOPO_EU_PER_DSS ||
topologyType == DRM_XE_TOPO_SIMD16_EU_PER_DSS;
}
} // namespace NEO

View File

@@ -13,7 +13,7 @@ namespace NEO {
class IoctlHelperXePrelim : public IoctlHelperXe {
public:
using IoctlHelperXe::IoctlHelperXe;
~IoctlHelperXePrelim() override;
bool isEuPerDssTopologyType(uint16_t topologyType) const override;
};
} // namespace NEO

View File

@@ -19,7 +19,6 @@ struct MockIoctlHelperXe : IoctlHelperXe {
using IoctlHelperXe::getFdFromVmExport;
using IoctlHelperXe::ioctl;
using IoctlHelperXe::IoctlHelperXe;
using IoctlHelperXe::isEuPerDssTopologyType;
using IoctlHelperXe::maxContextSetProperties;
using IoctlHelperXe::maxExecQueuePriority;
using IoctlHelperXe::queryGtListData;

View File

@@ -14,6 +14,13 @@ if(NEO_ENABLE_XE_EU_DEBUG_SUPPORT)
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_debugger_tests.cpp
)
endif()
if(NEO_ENABLE_XE_PRELIM_DETECTION)
list(APPEND NEO_CORE_OS_INTERFACE_TESTS_LINUX_XE
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_prelim_tests.cpp
)
endif()
set_property(GLOBAL APPEND PROPERTY NEO_CORE_OS_INTERFACE_TESTS_LINUX ${NEO_CORE_OS_INTERFACE_TESTS_LINUX_XE})
if(UNIX)

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/linux/drm_neo.h"
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe_prelim.h"
#include "shared/source/os_interface/linux/xe/xedrm_prelim.h"
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/test_macros/test.h"
using namespace NEO;
TEST(IoctlHelperXePrelimTest, givenSimd16EuPerDssTypeWhenCheckingIfTopologyIsEuPerDssThenSuccessIsReturned) {
MockExecutionEnvironment executionEnvironment{};
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
IoctlHelperXePrelim ioctlHelper{*drm};
EXPECT_TRUE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_SIMD16_EU_PER_DSS));
EXPECT_TRUE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_EU_PER_DSS));
EXPECT_FALSE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_DSS_GEOMETRY));
EXPECT_FALSE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_DSS_COMPUTE));
}

View File

@@ -2398,9 +2398,12 @@ TEST_F(IoctlHelperXeHwIpVersionTests, WhenSetupIpVersionIsCalledAndIoctlReturnsN
}
TEST(IoctlHelperXeTest, givenCorrectEuPerDssTypeWhenCheckingIfTopologyIsEuPerDssThenSuccessIsReturned) {
EXPECT_TRUE(MockIoctlHelperXe::isEuPerDssTopologyType(DRM_XE_TOPO_EU_PER_DSS));
EXPECT_FALSE(MockIoctlHelperXe::isEuPerDssTopologyType(DRM_XE_TOPO_DSS_GEOMETRY));
EXPECT_FALSE(MockIoctlHelperXe::isEuPerDssTopologyType(DRM_XE_TOPO_DSS_COMPUTE));
MockExecutionEnvironment executionEnvironment{};
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
IoctlHelperXe ioctlHelper{*drm};
EXPECT_TRUE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_EU_PER_DSS));
EXPECT_FALSE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_DSS_GEOMETRY));
EXPECT_FALSE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_DSS_COMPUTE));
}
TEST(IoctlHelperXeTest, givenIoctlHelperWhenSettingExtContextThenCallExternalIoctlFunction) {