Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dfbad80

Browse files
JablonskiMateuszCompute-Runtime-Automation
authored andcommittedSep 10, 2024
feature: add support for SIMD16 EU per DSS to xe-prelim helper
Related-To: NEO-12012 Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent 4f12626 commit dfbad80

File tree

10 files changed

+45
-24
lines changed

10 files changed

+45
-24
lines changed
 

‎shared/source/os_interface/linux/xe/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ set(NEO_CORE_OS_INTERFACE_LINUX_XE
1111
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.cpp
1212
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.h
1313
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/ioctl_helper_xe_perf.cpp
14-
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/ioctl_helper_xe_eu_dss.cpp
1514
${CMAKE_CURRENT_SOURCE_DIR}/xedrm.h
1615
${CMAKE_CURRENT_SOURCE_DIR}/xedrm_prelim.h
1716
)

‎shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,4 +1719,7 @@ void IoctlHelperXe::querySupportedFeatures() {
17191719
};
17201720
supportedFeatures.flags.pageFault = checkVmCreateFlagsSupport(DRM_XE_VM_CREATE_FLAG_LR_MODE | DRM_XE_VM_CREATE_FLAG_FAULT_MODE);
17211721
};
1722+
bool IoctlHelperXe::isEuPerDssTopologyType(uint16_t topologyType) const {
1723+
return topologyType == DRM_XE_TOPO_EU_PER_DSS;
1724+
}
17221725
} // namespace NEO

‎shared/source/os_interface/linux/xe/ioctl_helper_xe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ class IoctlHelperXe : public IoctlHelper {
133133
void registerBOBindHandle(Drm *drm, DrmAllocation *drmAllocation) override;
134134
bool resourceRegistrationEnabled() override { return true; }
135135
bool isPreemptionSupported() override { return true; }
136+
virtual bool isEuPerDssTopologyType(uint16_t topologyType) const;
136137

137138
protected:
138139
static constexpr uint32_t maxContextSetProperties = 4;
@@ -174,7 +175,6 @@ class IoctlHelperXe : public IoctlHelper {
174175
uint16_t revision;
175176
};
176177
bool queryHwIpVersion(GtIpVersion &gtIpVersion);
177-
static bool isEuPerDssTopologyType(uint16_t topologyType);
178178

179179
int maxExecQueuePriority = 0;
180180
std::mutex xeLock;

‎shared/source/os_interface/linux/xe/ioctl_helper_xe_eu_dss.cpp

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎shared/source/os_interface/linux/xe/ioctl_helper_xe_prelim.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
namespace NEO {
1313

14-
IoctlHelperXePrelim::~IoctlHelperXePrelim() {
15-
xeLog("IoctlHelperXePrelim::~IoctlHelperXePrelim\n", "");
14+
bool IoctlHelperXePrelim::isEuPerDssTopologyType(uint16_t topologyType) const {
15+
return topologyType == DRM_XE_TOPO_EU_PER_DSS ||
16+
topologyType == DRM_XE_TOPO_SIMD16_EU_PER_DSS;
1617
}
1718
} // namespace NEO

‎shared/source/os_interface/linux/xe/ioctl_helper_xe_prelim.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace NEO {
1313
class IoctlHelperXePrelim : public IoctlHelperXe {
1414
public:
1515
using IoctlHelperXe::IoctlHelperXe;
16-
~IoctlHelperXePrelim() override;
16+
bool isEuPerDssTopologyType(uint16_t topologyType) const override;
1717
};
1818

1919
} // namespace NEO

‎shared/test/common/os_interface/linux/xe/mock_ioctl_helper_xe.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ struct MockIoctlHelperXe : IoctlHelperXe {
1919
using IoctlHelperXe::getFdFromVmExport;
2020
using IoctlHelperXe::ioctl;
2121
using IoctlHelperXe::IoctlHelperXe;
22-
using IoctlHelperXe::isEuPerDssTopologyType;
2322
using IoctlHelperXe::maxContextSetProperties;
2423
using IoctlHelperXe::maxExecQueuePriority;
2524
using IoctlHelperXe::queryGtListData;

‎shared/test/unit_test/os_interface/linux/xe/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ if(NEO_ENABLE_XE_EU_DEBUG_SUPPORT)
1414
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_debugger_tests.cpp
1515
)
1616
endif()
17+
18+
if(NEO_ENABLE_XE_PRELIM_DETECTION)
19+
list(APPEND NEO_CORE_OS_INTERFACE_TESTS_LINUX_XE
20+
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_prelim_tests.cpp
21+
)
22+
endif()
23+
1724
set_property(GLOBAL APPEND PROPERTY NEO_CORE_OS_INTERFACE_TESTS_LINUX ${NEO_CORE_OS_INTERFACE_TESTS_LINUX_XE})
1825

1926
if(UNIX)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (C) 2024 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "shared/source/os_interface/linux/drm_neo.h"
9+
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe_prelim.h"
10+
#include "shared/source/os_interface/linux/xe/xedrm_prelim.h"
11+
#include "shared/test/common/mocks/mock_execution_environment.h"
12+
#include "shared/test/common/test_macros/test.h"
13+
14+
using namespace NEO;
15+
16+
TEST(IoctlHelperXePrelimTest, givenSimd16EuPerDssTypeWhenCheckingIfTopologyIsEuPerDssThenSuccessIsReturned) {
17+
MockExecutionEnvironment executionEnvironment{};
18+
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
19+
IoctlHelperXePrelim ioctlHelper{*drm};
20+
EXPECT_TRUE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_SIMD16_EU_PER_DSS));
21+
EXPECT_TRUE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_EU_PER_DSS));
22+
EXPECT_FALSE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_DSS_GEOMETRY));
23+
EXPECT_FALSE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_DSS_COMPUTE));
24+
}

‎shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,9 +2398,12 @@ TEST_F(IoctlHelperXeHwIpVersionTests, WhenSetupIpVersionIsCalledAndIoctlReturnsN
23982398
}
23992399

24002400
TEST(IoctlHelperXeTest, givenCorrectEuPerDssTypeWhenCheckingIfTopologyIsEuPerDssThenSuccessIsReturned) {
2401-
EXPECT_TRUE(MockIoctlHelperXe::isEuPerDssTopologyType(DRM_XE_TOPO_EU_PER_DSS));
2402-
EXPECT_FALSE(MockIoctlHelperXe::isEuPerDssTopologyType(DRM_XE_TOPO_DSS_GEOMETRY));
2403-
EXPECT_FALSE(MockIoctlHelperXe::isEuPerDssTopologyType(DRM_XE_TOPO_DSS_COMPUTE));
2401+
MockExecutionEnvironment executionEnvironment{};
2402+
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
2403+
IoctlHelperXe ioctlHelper{*drm};
2404+
EXPECT_TRUE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_EU_PER_DSS));
2405+
EXPECT_FALSE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_DSS_GEOMETRY));
2406+
EXPECT_FALSE(ioctlHelper.isEuPerDssTopologyType(DRM_XE_TOPO_DSS_COMPUTE));
24042407
}
24052408

24062409
TEST(IoctlHelperXeTest, givenIoctlHelperWhenSettingExtContextThenCallExternalIoctlFunction) {

0 commit comments

Comments
 (0)
Please sign in to comment.