Refactor implicit scaling device support

Related-To: NEO-6589

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-01-11 19:41:57 +00:00
committed by Compute-Runtime-Automation
parent dd63f96836
commit 4238679078
25 changed files with 175 additions and 45 deletions

View File

@@ -635,6 +635,7 @@ HWTEST_F(CrossDeviceDependenciesTests, givenWaitListWithEventBlockedByUserEventW
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenStaticPartitioningEnabledWhenFlushingTaskThenWorkPartitionAllocationIsMadeResident) {
DebugManagerStateRestore restore{};
DebugManager.flags.EnableStaticPartitioning.set(1);
DebugManager.flags.EnableImplicitScaling.set(1);
DebugManager.flags.ForcePreemptionMode.set(PreemptionMode::Disabled);
UltDeviceFactory deviceFactory{1, 2};
MockDevice *device = deviceFactory.rootDevices[0];

View File

@@ -819,6 +819,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi
struct CommandStreamReceiverFlushTaskXeHPAndLaterMultiTileTests : public CommandStreamReceiverFlushTaskXeHPAndLaterTests {
void SetUp() override {
DebugManager.flags.CreateMultipleSubDevices.set(2);
DebugManager.flags.EnableImplicitScaling.set(1);
parsePipeControl = true;
CommandStreamReceiverFlushTaskXeHPAndLaterTests::SetUp();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -826,6 +826,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenPlatf
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, whenCreatingWorkPartitionAllocationThenItsPropertiesAreCorrect) {
DebugManagerStateRestore restore{};
DebugManager.flags.EnableStaticPartitioning.set(1);
DebugManager.flags.EnableImplicitScaling.set(1);
DebugManager.flags.EnableLocalMemory.set(1);
UltDeviceFactory deviceFactory{1, 2};
MockDevice &rootDevice = *deviceFactory.rootDevices[0];

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -446,6 +446,7 @@ HWTEST_F(DeviceTest, givenDeviceWhenAskingForDefaultEngineThenReturnValidValue)
HWTEST_F(DeviceTest, givenDebugFlagWhenCreatingRootDeviceWithSubDevicesThenWorkPartitionAllocationIsCreatedForRootDevice) {
DebugManagerStateRestore restore{};
DebugManager.flags.EnableImplicitScaling.set(1);
{
UltDeviceFactory deviceFactory{1, 2};
EXPECT_NE(nullptr, deviceFactory.rootDevices[0]->getDefaultEngine().commandStreamReceiver->getWorkPartitionAllocation());
@@ -479,6 +480,7 @@ HWTEST_F(DeviceTest, givenDebugFlagWhenCreatingRootDeviceWithSubDevicesThenWorkP
HWTEST_F(DeviceTest, givenDebugFlagWhenCreatingRootDeviceWithoutSubDevicesThenWorkPartitionAllocationIsNotCreated) {
DebugManagerStateRestore restore{};
DebugManager.flags.EnableImplicitScaling.set(1);
{
UltDeviceFactory deviceFactory{1, 1};
EXPECT_EQ(nullptr, deviceFactory.rootDevices[0]->getDefaultEngine().commandStreamReceiver->getWorkPartitionAllocation());

View File

@@ -1054,16 +1054,18 @@ HWTEST_F(KernelResidencyTest, givenKernelWhenMakeResidentIsCalledThenExportedFun
// check getResidency as well
std::vector<NEO::Surface *> residencySurfaces;
pKernel->getResidency(residencySurfaces);
std::unique_ptr<NEO::ExecutionEnvironment> mockCsrExecEnv;
std::unique_ptr<NEO::ExecutionEnvironment> mockCsrExecEnv = std::make_unique<ExecutionEnvironment>();
mockCsrExecEnv->prepareRootDeviceEnvironments(1);
mockCsrExecEnv->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
mockCsrExecEnv->initializeMemoryManager();
{
CommandStreamReceiverMock csrMock;
CommandStreamReceiverMock csrMock(*mockCsrExecEnv.get(), 0, 1);
csrMock.passResidencyCallToBaseClass = false;
for (const auto &s : residencySurfaces) {
s->makeResident(csrMock);
delete s;
}
EXPECT_EQ(1U, csrMock.residency.count(exportedFunctionsSurface->getUnderlyingBuffer()));
mockCsrExecEnv = std::move(csrMock.mockExecutionEnvironment);
}
memoryManager->freeGraphicsMemory(pKernelInfo->kernelAllocation);
@@ -1092,16 +1094,18 @@ HWTEST_F(KernelResidencyTest, givenKernelWhenMakeResidentIsCalledThenGlobalBuffe
std::vector<NEO::Surface *> residencySurfaces;
pKernel->getResidency(residencySurfaces);
std::unique_ptr<NEO::ExecutionEnvironment> mockCsrExecEnv;
std::unique_ptr<NEO::ExecutionEnvironment> mockCsrExecEnv = std::make_unique<ExecutionEnvironment>();
mockCsrExecEnv->prepareRootDeviceEnvironments(1);
mockCsrExecEnv->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
mockCsrExecEnv->initializeMemoryManager();
{
CommandStreamReceiverMock csrMock;
CommandStreamReceiverMock csrMock(*mockCsrExecEnv.get(), 0, 1);
csrMock.passResidencyCallToBaseClass = false;
for (const auto &s : residencySurfaces) {
s->makeResident(csrMock);
delete s;
}
EXPECT_EQ(1U, csrMock.residency.count(program.buildInfos[pDevice->getRootDeviceIndex()].globalSurface->getUnderlyingBuffer()));
mockCsrExecEnv = std::move(csrMock.mockExecutionEnvironment);
}
memoryManager->freeGraphicsMemory(pKernelInfo->kernelAllocation);