Compile DG1 and XE_HP_SDV by default

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek 2021-11-02 15:36:22 +00:00 committed by Compute-Runtime-Automation
parent 908fbe427b
commit c5d403d65a
5 changed files with 28 additions and 1 deletions

View File

@ -7,7 +7,8 @@
SET_FLAGS_FOR("GEN8" "BDW")
SET_FLAGS_FOR("GEN9" "SKL" "KBL" "BXT" "GLK" "CFL")
SET_FLAGS_FOR("GEN11" "ICLLP" "LKF" "EHL")
SET_FLAGS_FOR("GEN12LP" "TGLLP" "RKL" "ADLS" "ADLP")
SET_FLAGS_FOR("GEN12LP" "TGLLP" "RKL" "ADLS" "ADLP" "DG1")
SET_FLAGS_FOR("XE_HP_CORE" "XE_HP_SDV")
foreach(GEN_TYPE ${XEHP_AND_LATER_GENS})
if(TESTS_${GEN_TYPE})

View File

@ -18,6 +18,8 @@
using namespace NEO;
TEST(MemoryInfo, givenMemoryRegionQuerySupportedWhenQueryingMemoryInfoThenMemoryInfoIsCreatedWithRegions) {
DebugManagerStateRestore restorer;
DebugManager.flags.EnableLocalMemory.set(1);
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
@ -33,6 +35,8 @@ TEST(MemoryInfo, givenMemoryRegionQuerySupportedWhenQueryingMemoryInfoThenMemory
}
TEST(MemoryInfo, givenMemoryRegionQueryNotSupportedWhenQueryingMemoryInfoThenMemoryInfoIsNotCreated) {
DebugManagerStateRestore restorer;
DebugManager.flags.EnableLocalMemory.set(1);
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
auto drm = std::make_unique<DrmMockExp>(*executionEnvironment->rootDeviceEnvironments[0]);
@ -46,6 +50,8 @@ TEST(MemoryInfo, givenMemoryRegionQueryNotSupportedWhenQueryingMemoryInfoThenMem
}
TEST(MemoryInfo, givenMemoryRegionQueryWhenQueryingFailsThenMemoryInfoIsNotCreated) {
DebugManagerStateRestore restorer;
DebugManager.flags.EnableLocalMemory.set(1);
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
auto drm = std::make_unique<DrmMockExp>(*executionEnvironment->rootDeviceEnvironments[0]);

View File

@ -906,6 +906,17 @@ TEST_F(DrmMemoryManagerTestExp, givenDrmMemoryManagerWhenGetLocalMemorySizeIsCal
EXPECT_EQ(memoryInfo->getMemoryRegionSize(MemoryBanks::getBankForLocalMemory(0)), memoryManager.getLocalMemorySize(0u, 0xF));
}
TEST_F(DrmMemoryManagerTestExp, givenLocalMemoryDisabledWhenQueryMemoryInfoThenReturnTrueAndDontCreateMemoryInfo) {
DebugManagerStateRestore restorer;
DebugManager.flags.EnableLocalMemory.set(0);
MockExecutionEnvironment executionEnvironment;
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
auto drm = std::make_unique<DrmMock>(*executionEnvironment.rootDeviceEnvironments[0]);
auto ret = drm->queryMemoryInfo();
EXPECT_TRUE(ret);
EXPECT_EQ(nullptr, drm->memoryInfo);
}
TEST_F(DrmMemoryManagerTestExp, givenDrmMemoryManagerWhenGetLocalMemorySizeIsCalledForMemoryInfoAndInvalidDeviceBitfieldThenReturnZero) {
MockExecutionEnvironment executionEnvironment;
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();

View File

@ -90,6 +90,8 @@ DG1TEST_F(LocalMemoryHelperTestsDg1, givenDg1WhenCreateGemExtWithDebugFlagThenPr
}
DG1TEST_F(LocalMemoryHelperTestsDg1, givenDg1AndMemoryRegionQuerySupportedWhenQueryingMemoryInfoThenMemoryInfoIsCreatedWithRegions) {
DebugManagerStateRestore restorer;
DebugManager.flags.EnableLocalMemory.set(1);
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);

View File

@ -6,6 +6,7 @@
*/
#include "shared/source/helpers/debug_helpers.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/string.h"
#include "shared/source/os_interface/linux/drm_engine_mapper.h"
#include "shared/source/os_interface/linux/engine_info_impl.h"
@ -44,6 +45,12 @@ bool Drm::queryEngineInfo(bool isSysmanEnabled) {
}
bool Drm::queryMemoryInfo() {
auto pHwInfo = getRootDeviceEnvironment().getHardwareInfo();
auto isLocalMemSupported = HwHelper::get(pHwInfo->platform.eRenderCoreFamily).getEnableLocalMemory(*pHwInfo);
if (!isLocalMemSupported) {
return true;
}
auto length = 0;
auto dataQuery = this->query(DRM_I915_QUERY_MEMORY_REGIONS, DrmQueryItemFlags::empty, length);
if (dataQuery) {