Set SkipResourceCleanup in TBX mode

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2022-10-26 11:31:37 +00:00
committed by Compute-Runtime-Automation
parent 7ff37cd5fd
commit 06a647a5e9
5 changed files with 13 additions and 1 deletions

View File

@@ -276,7 +276,7 @@ bool CommandStreamReceiver::isRcs() const {
}
bool CommandStreamReceiver::skipResourceCleanup() const {
return this->getOSInterface() && this->getOSInterface()->getDriverModel() && this->getOSInterface()->getDriverModel()->skipResourceCleanup();
return ((this->getOSInterface() && this->getOSInterface()->getDriverModel() && this->getOSInterface()->getDriverModel()->skipResourceCleanup()) || forceSkipResourceCleanupRequired);
}
bool CommandStreamReceiver::isGpuHangDetected() const {

View File

@@ -500,6 +500,7 @@ class CommandStreamReceiver {
bool lastSentUseGlobalAtomics = false;
bool useNotifyEnableForPostSync = false;
bool dcFlushSupport = false;
bool forceSkipResourceCleanupRequired = false;
};
typedef CommandStreamReceiver *(*CommandStreamReceiverCreateFunc)(bool withAubDump,

View File

@@ -27,6 +27,7 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
protected:
typedef CommandStreamReceiverSimulatedHw<GfxFamily> BaseClass;
using AUB = typename AUBFamilyMapper<GfxFamily>::AUB;
using BaseClass::forceSkipResourceCleanupRequired;
using BaseClass::getParametersForWriteMemory;
using BaseClass::osContext;

View File

@@ -40,6 +40,8 @@ TbxCommandStreamReceiverHw<GfxFamily>::TbxCommandStreamReceiverHw(ExecutionEnvir
const DeviceBitfield deviceBitfield)
: BaseClass(executionEnvironment, rootDeviceIndex, deviceBitfield) {
forceSkipResourceCleanupRequired = true;
physicalAddressAllocator.reset(this->createPhysicalAddressAllocator(&this->peekHwInfo()));
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->initAubCenter(this->localMemoryEnabled, "", this->getType());
auto aubCenter = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->aubCenter.get();

View File

@@ -117,6 +117,14 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeResidentIsC
memoryManager->freeGraphicsMemory(graphicsAllocation);
}
TEST(TbxCommandStreamReceiverTest, givenTbxCommandStreamReceiverWhenAskingForSkipResourceCleanupThenReturnTrue) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
executionEnvironment->initializeMemoryManager();
std::unique_ptr<CommandStreamReceiver> csr(TbxCommandStreamReceiver::create("", false, *executionEnvironment, 0, 1));
EXPECT_NE(nullptr, csr);
EXPECT_TRUE(csr->skipResourceCleanup());
}
HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenItIsCreatedWithAubDumpAndAubCaptureFileNameHasBeenSpecifiedThenItShouldBeUsedToOpenTheFileWithAubCapture) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.AUBDumpCaptureFileName.set("aubcapture_file_name.aub");