test: Remove resetCommandStreamReceiver from tests

Related-To: NEO-3927
Signed-off-by: Kindracki, Jakub Tomasz <jakub.tomasz.kindracki@intel.com>
This commit is contained in:
Kindracki, Jakub Tomasz
2025-05-27 17:24:03 +00:00
committed by Compute-Runtime-Automation
parent 1dfc9227c4
commit d0234c0bef
19 changed files with 407 additions and 276 deletions

View File

@@ -2145,6 +2145,9 @@ HWTEST_F(EventAubCsrTest, givenCallToEventHostSynchronizeWithAubModeCsrReturnsSu
NEO::MockDevice *neoDevice = nullptr;
L0::Device *device = nullptr;
EnvironmentWithCsrWrapper environment;
environment.setCsrType<MockCsrAub<FamilyType>>();
neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get());
auto mockBuiltIns = new MockBuiltins();
MockRootDeviceEnvironment::resetBuiltins(neoDevice->executionEnvironment->rootDeviceEnvironments[0].get(), mockBuiltIns);
@@ -2153,9 +2156,6 @@ HWTEST_F(EventAubCsrTest, givenCallToEventHostSynchronizeWithAubModeCsrReturnsSu
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->initialize(std::move(devices));
device = driverHandle->devices[0];
int32_t tag;
auto aubCsr = new MockCsrAub<FamilyType>(tag, *neoDevice->executionEnvironment, neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield());
neoDevice->resetCommandStreamReceiver(aubCsr);
std::unique_ptr<L0::EventPool> eventPool = nullptr;
std::unique_ptr<L0::Event> event;

View File

@@ -293,6 +293,9 @@ HWTEST_F(FenceAubCsrTest, givenCallToFenceHostSynchronizeWithAubModeCsrReturnsSu
NEO::MockDevice *neoDevice = nullptr;
L0::Device *device = nullptr;
EnvironmentWithCsrWrapper environment;
environment.setCsrType<MockCsrAub<FamilyType>>();
neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get());
auto mockBuiltIns = new MockBuiltins();
MockRootDeviceEnvironment::resetBuiltins(neoDevice->executionEnvironment->rootDeviceEnvironments[0].get(), mockBuiltIns);
@@ -301,9 +304,7 @@ HWTEST_F(FenceAubCsrTest, givenCallToFenceHostSynchronizeWithAubModeCsrReturnsSu
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->initialize(std::move(devices));
device = driverHandle->devices[0];
int32_t tag = 1;
auto aubCsr = new MockCsrAub<FamilyType>(tag, *neoDevice->executionEnvironment, neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield());
neoDevice->resetCommandStreamReceiver(aubCsr);
auto aubCsr = static_cast<MockCsrAub<FamilyType> *>(&neoDevice->getUltCommandStreamReceiver<FamilyType>());
Mock<CommandQueue> cmdQueue(device, aubCsr);
ze_fence_desc_t fenceDesc = {};

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2024 Intel Corporation
* Copyright (C) 2022-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -79,15 +79,15 @@ TEST_F(ModuleTests, whenCreatingAutoGrfBuildOptionsThenOptionsParsedCorrectly) {
}
TEST(ModuleDestroyTest, givenIsaAllocationWhenIsModuleDestroyedThenRequireInstructionCacheFlushInCsrThatUsedTheAllocation) {
EnvironmentWithCsrWrapper environment;
environment.setCsrType<MockCommandStreamReceiver>();
const uint32_t rootDeviceIndex = 0u;
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, rootDeviceIndex);
MockCommandStreamReceiver *mockCommandStreamReceiver = new MockCommandStreamReceiver(*neoMockDevice->executionEnvironment, neoMockDevice->getRootDeviceIndex(), neoMockDevice->getDeviceBitfield());
auto mockCommandStreamReceiver = static_cast<MockCommandStreamReceiver *>(&neoMockDevice->getGpgpuCommandStreamReceiver());
mockCommandStreamReceiver->makeResidentParentCall = true;
neoMockDevice->resetCommandStreamReceiver(mockCommandStreamReceiver);
MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment());
auto module = new MockModule{&deviceImp, nullptr, ModuleType::user};
@@ -109,15 +109,15 @@ TEST(ModuleDestroyTest, givenIsaAllocationWhenIsModuleDestroyedThenRequireInstru
}
TEST(ModuleDestroyTest, givenKernelImmutableDataWithNullIsaAllocationWhenIsModuleDestroyedThenRequiresInstructionCacheFlushIsNotSetInCsr) {
EnvironmentWithCsrWrapper environment;
environment.setCsrType<MockCommandStreamReceiver>();
const uint32_t rootDeviceIndex = 0u;
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, rootDeviceIndex);
MockCommandStreamReceiver *mockCommandStreamReceiver = new MockCommandStreamReceiver(*neoMockDevice->executionEnvironment, neoMockDevice->getRootDeviceIndex(), neoMockDevice->getDeviceBitfield());
auto mockCommandStreamReceiver = static_cast<MockCommandStreamReceiver *>(&neoMockDevice->getGpgpuCommandStreamReceiver());
mockCommandStreamReceiver->makeResidentParentCall = true;
neoMockDevice->resetCommandStreamReceiver(mockCommandStreamReceiver);
MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment());
auto module = new MockModule{&deviceImp, nullptr, ModuleType::user};