Skip dumping aub allocations on BCS engine

Change-Id: I7d1cf3b0a0d6e16fd2df2fad1ba5e71dfe04ae23
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-11-25 18:37:19 +01:00
committed by sys_ocldev
parent 472a75912d
commit aafebb2e85
4 changed files with 33 additions and 0 deletions

View File

@@ -22,6 +22,7 @@
#include "runtime/command_stream/aub_subcapture.h"
#include "runtime/command_stream/command_stream_receiver.h"
#include "runtime/execution_environment/execution_environment.h"
#include "runtime/helpers/engine_node_helper.h"
#include "runtime/helpers/hardware_context_controller.h"
#include "runtime/helpers/neo_driver_version.h"
#include "runtime/memory_manager/memory_banks.h"
@@ -728,6 +729,10 @@ void AUBCommandStreamReceiverHw<GfxFamily>::processResidency(const ResidencyCont
template <typename GfxFamily>
void AUBCommandStreamReceiverHw<GfxFamily>::dumpAllocation(GraphicsAllocation &gfxAllocation) {
if (isBcs(this->osContext->getEngineType())) {
return;
}
if (DebugManager.flags.AUBDumpAllocsOnEnqueueReadOnly.get()) {
if (!gfxAllocation.isAllocDumpable()) {
return;

View File

@@ -13,4 +13,8 @@ bool isCcs(aub_stream::EngineType engineType) {
return engineType == aub_stream::ENGINE_CCS;
}
bool isBcs(aub_stream::EngineType engineType) {
return engineType == aub_stream::ENGINE_BCS;
}
} // namespace NEO

View File

@@ -12,5 +12,6 @@
namespace NEO {
bool isCcs(aub_stream::EngineType engineType);
bool isBcs(aub_stream::EngineType engineType);
} // namespace NEO

View File

@@ -889,6 +889,29 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
memoryManager->freeGraphicsMemory(gfxAllocation);
}
HWTEST_F(AubCommandStreamReceiverTests, givenBcsEngineWhenDumpAllocationCalledThenIgnore) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.AUBDumpBufferFormat.set("BIN");
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex());
MockOsContext osContext(0, 1, aub_stream::ENGINE_BCS, PreemptionMode::Disabled, false);
aubCsr.setupContext(osContext);
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
auto memoryManager = pDevice->getMemoryManager();
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
aubCsr.dumpAllocation(*gfxAllocation);
EXPECT_FALSE(mockHardwareContext->dumpSurfaceCalled);
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
memoryManager->freeGraphicsMemory(gfxAllocation);
}
HWTEST_F(AubCommandStreamReceiverTests, givenCompressedGraphicsAllocationWritableWhenDumpAllocationIsCalledAndDumpFormatIsSpecifiedThenGraphicsAllocationShouldBeDumped) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.AUBDumpBufferFormat.set("TRE");