Skip to content

Commit c5d403d

Browse files
Compile DG1 and XE_HP_SDV by default
Signed-off-by: Szymon Morek <[email protected]>
1 parent 908fbe4 commit c5d403d

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed

cmake/setup_platform_flags.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
SET_FLAGS_FOR("GEN8" "BDW")
88
SET_FLAGS_FOR("GEN9" "SKL" "KBL" "BXT" "GLK" "CFL")
99
SET_FLAGS_FOR("GEN11" "ICLLP" "LKF" "EHL")
10-
SET_FLAGS_FOR("GEN12LP" "TGLLP" "RKL" "ADLS" "ADLP")
10+
SET_FLAGS_FOR("GEN12LP" "TGLLP" "RKL" "ADLS" "ADLP" "DG1")
11+
SET_FLAGS_FOR("XE_HP_CORE" "XE_HP_SDV")
1112

1213
foreach(GEN_TYPE ${XEHP_AND_LATER_GENS})
1314
if(TESTS_${GEN_TYPE})

opencl/test/unit_test/os_interface/linux/drm_memory_info_tests_exp.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
using namespace NEO;
1919

2020
TEST(MemoryInfo, givenMemoryRegionQuerySupportedWhenQueryingMemoryInfoThenMemoryInfoIsCreatedWithRegions) {
21+
DebugManagerStateRestore restorer;
22+
DebugManager.flags.EnableLocalMemory.set(1);
2123
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
2224
executionEnvironment->prepareRootDeviceEnvironments(1);
2325

@@ -33,6 +35,8 @@ TEST(MemoryInfo, givenMemoryRegionQuerySupportedWhenQueryingMemoryInfoThenMemory
3335
}
3436

3537
TEST(MemoryInfo, givenMemoryRegionQueryNotSupportedWhenQueryingMemoryInfoThenMemoryInfoIsNotCreated) {
38+
DebugManagerStateRestore restorer;
39+
DebugManager.flags.EnableLocalMemory.set(1);
3640
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
3741
executionEnvironment->prepareRootDeviceEnvironments(1);
3842
auto drm = std::make_unique<DrmMockExp>(*executionEnvironment->rootDeviceEnvironments[0]);
@@ -46,6 +50,8 @@ TEST(MemoryInfo, givenMemoryRegionQueryNotSupportedWhenQueryingMemoryInfoThenMem
4650
}
4751

4852
TEST(MemoryInfo, givenMemoryRegionQueryWhenQueryingFailsThenMemoryInfoIsNotCreated) {
53+
DebugManagerStateRestore restorer;
54+
DebugManager.flags.EnableLocalMemory.set(1);
4955
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
5056
executionEnvironment->prepareRootDeviceEnvironments(1);
5157
auto drm = std::make_unique<DrmMockExp>(*executionEnvironment->rootDeviceEnvironments[0]);

opencl/test/unit_test/os_interface/linux/drm_memory_manager_localmem_tests.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,17 @@ TEST_F(DrmMemoryManagerTestExp, givenDrmMemoryManagerWhenGetLocalMemorySizeIsCal
906906
EXPECT_EQ(memoryInfo->getMemoryRegionSize(MemoryBanks::getBankForLocalMemory(0)), memoryManager.getLocalMemorySize(0u, 0xF));
907907
}
908908

909+
TEST_F(DrmMemoryManagerTestExp, givenLocalMemoryDisabledWhenQueryMemoryInfoThenReturnTrueAndDontCreateMemoryInfo) {
910+
DebugManagerStateRestore restorer;
911+
DebugManager.flags.EnableLocalMemory.set(0);
912+
MockExecutionEnvironment executionEnvironment;
913+
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
914+
auto drm = std::make_unique<DrmMock>(*executionEnvironment.rootDeviceEnvironments[0]);
915+
auto ret = drm->queryMemoryInfo();
916+
EXPECT_TRUE(ret);
917+
EXPECT_EQ(nullptr, drm->memoryInfo);
918+
}
919+
909920
TEST_F(DrmMemoryManagerTestExp, givenDrmMemoryManagerWhenGetLocalMemorySizeIsCalledForMemoryInfoAndInvalidDeviceBitfieldThenReturnZero) {
910921
MockExecutionEnvironment executionEnvironment;
911922
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();

opencl/test/unit_test/os_interface/linux/local_memory_helper_tests_dg1.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ DG1TEST_F(LocalMemoryHelperTestsDg1, givenDg1WhenCreateGemExtWithDebugFlagThenPr
9090
}
9191

9292
DG1TEST_F(LocalMemoryHelperTestsDg1, givenDg1AndMemoryRegionQuerySupportedWhenQueryingMemoryInfoThenMemoryInfoIsCreatedWithRegions) {
93+
DebugManagerStateRestore restorer;
94+
DebugManager.flags.EnableLocalMemory.set(1);
9395
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
9496
executionEnvironment->prepareRootDeviceEnvironments(1);
9597

shared/source/os_interface/linux/drm_query_exp.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include "shared/source/helpers/debug_helpers.h"
9+
#include "shared/source/helpers/hw_helper.h"
910
#include "shared/source/helpers/string.h"
1011
#include "shared/source/os_interface/linux/drm_engine_mapper.h"
1112
#include "shared/source/os_interface/linux/engine_info_impl.h"
@@ -44,6 +45,12 @@ bool Drm::queryEngineInfo(bool isSysmanEnabled) {
4445
}
4546

4647
bool Drm::queryMemoryInfo() {
48+
auto pHwInfo = getRootDeviceEnvironment().getHardwareInfo();
49+
auto isLocalMemSupported = HwHelper::get(pHwInfo->platform.eRenderCoreFamily).getEnableLocalMemory(*pHwInfo);
50+
if (!isLocalMemSupported) {
51+
return true;
52+
}
53+
4754
auto length = 0;
4855
auto dataQuery = this->query(DRM_I915_QUERY_MEMORY_REGIONS, DrmQueryItemFlags::empty, length);
4956
if (dataQuery) {

0 commit comments

Comments
 (0)