test: Remove resetCommandStreamReceiver from tests

Changed the implementation to use EnvironmentWithCsrWrapper with setUpT
instead of resetCommandStreamReceiver.
Changed related tests to templated 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-09 10:59:43 +00:00
committed by Compute-Runtime-Automation
parent f7eb16cb70
commit 2ce3f4fa40
13 changed files with 312 additions and 176 deletions

View File

@@ -63,6 +63,11 @@ struct MockAubCsr : public AUBCommandStreamReceiverHw<GfxFamily> {
using AUBCommandStreamReceiverHw<GfxFamily>::pollForCompletion;
using AUBCommandStreamReceiverHw<GfxFamily>::AUBCommandStreamReceiverHw;
MockAubCsr(ExecutionEnvironment &executionEnvironment,
uint32_t rootDeviceIndex,
const DeviceBitfield deviceBitfield)
: AUBCommandStreamReceiverHw<GfxFamily>("", true, executionEnvironment, rootDeviceIndex, deviceBitfield) {}
CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart,
const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh,
TaskCountType taskLevel, DispatchFlags &dispatchFlags, Device &device) override {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -32,6 +32,12 @@ class MockCsrBase : public UltCommandStreamReceiver<GfxFamily> {
: BaseUltCsrClass(executionEnvironment, rootDeviceIndex, deviceBitfield), executionStamp(&execStamp), flushTaskStamp(-1) {
}
MockCsrBase(ExecutionEnvironment &executionEnvironment,
uint32_t rootDeviceIndex,
const DeviceBitfield deviceBitfield)
: BaseUltCsrClass(executionEnvironment, rootDeviceIndex, deviceBitfield), executionStamp(&defaultExecStamp), flushTaskStamp(-1) {
}
void makeResident(GraphicsAllocation &gfxAllocation) override {
madeResidentGfxAllocations.push_back(&gfxAllocation);
if (this->getMemoryManager()) {
@@ -81,6 +87,7 @@ class MockCsrBase : public UltCommandStreamReceiver<GfxFamily> {
int32_t flushTaskStamp;
uint32_t waitForTaskCountWithKmdNotifyFallbackCalled = 0;
bool processEvictionCalled = false;
int32_t defaultExecStamp = 0;
};
template <typename GfxFamily>
@@ -94,6 +101,10 @@ class MockCsrAub : public MockCsrBase<GfxFamily> {
uint32_t rootDeviceIndex,
const DeviceBitfield deviceBitfield)
: MockCsrBase<GfxFamily>(execStamp, executionEnvironment, rootDeviceIndex, deviceBitfield) {}
MockCsrAub(ExecutionEnvironment &executionEnvironment,
uint32_t rootDeviceIndex,
const DeviceBitfield deviceBitfield)
: MockCsrBase<GfxFamily>(MockCsrBase<GfxFamily>::defaultExecStamp, executionEnvironment, rootDeviceIndex, deviceBitfield) {}
CommandStreamReceiverType getType() const override {
return CommandStreamReceiverType::aub;
}
@@ -114,6 +125,11 @@ class MockCsr : public MockCsrBase<GfxFamily> {
const DeviceBitfield deviceBitfield)
: BaseClass(execStamp, executionEnvironment, rootDeviceIndex, deviceBitfield) {
}
MockCsr(ExecutionEnvironment &executionEnvironment,
uint32_t rootDeviceIndex,
const DeviceBitfield deviceBitfield)
: BaseClass(BaseClass::defaultExecStamp, executionEnvironment, rootDeviceIndex, deviceBitfield) {
}
SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override {
return SubmissionStatus::success;