mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
performance: remove not needed logic
Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d52330b5aa
commit
0ec4e9333d
@@ -99,7 +99,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
|
||||
using BaseClass::CommandStreamReceiver::baseWaitFunction;
|
||||
using BaseClass::CommandStreamReceiver::bindingTableBaseAddressRequired;
|
||||
using BaseClass::CommandStreamReceiver::canUse4GbHeaps;
|
||||
using BaseClass::CommandStreamReceiver::checkForNewResources;
|
||||
using BaseClass::CommandStreamReceiver::checkImplicitFlushForGpuIdle;
|
||||
using BaseClass::CommandStreamReceiver::cleanupResources;
|
||||
using BaseClass::CommandStreamReceiver::clearColorAllocation;
|
||||
|
||||
@@ -33,7 +33,6 @@ class MockCommandStreamReceiver : public CommandStreamReceiver {
|
||||
public:
|
||||
using CommandStreamReceiver::activePartitions;
|
||||
using CommandStreamReceiver::baseWaitFunction;
|
||||
using CommandStreamReceiver::checkForNewResources;
|
||||
using CommandStreamReceiver::checkImplicitFlushForGpuIdle;
|
||||
using CommandStreamReceiver::cleanupResources;
|
||||
using CommandStreamReceiver::CommandStreamReceiver;
|
||||
|
||||
@@ -1609,85 +1609,6 @@ TEST(CommandStreamReceiverSimpleTest, givenBaseCsrWhenWritingMemoryThenReturnFal
|
||||
EXPECT_FALSE(csr.writeMemory(mockAllocation));
|
||||
}
|
||||
|
||||
TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushDisabledWhenProvidingNeverUsedAllocationTaskCountThenDoNotMarkNewResourceTrue) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
DeviceBitfield deviceBitfield(1);
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
|
||||
MockGraphicsAllocation mockAllocation;
|
||||
|
||||
csr.useNewResourceImplicitFlush = false;
|
||||
csr.newResources = false;
|
||||
csr.checkForNewResources(10u, GraphicsAllocation::objectNotUsed, mockAllocation);
|
||||
EXPECT_FALSE(csr.newResources);
|
||||
}
|
||||
|
||||
TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingNeverUsedAllocationTaskCountThenMarkNewResourceTrue) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
DeviceBitfield deviceBitfield(1);
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
|
||||
MockGraphicsAllocation mockAllocation;
|
||||
|
||||
csr.useNewResourceImplicitFlush = true;
|
||||
csr.newResources = false;
|
||||
csr.checkForNewResources(10u, GraphicsAllocation::objectNotUsed, mockAllocation);
|
||||
EXPECT_TRUE(csr.newResources);
|
||||
}
|
||||
|
||||
TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingNeverUsedAllocationThatIsKernelIsaThenMarkNewResourceFalse) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
DeviceBitfield deviceBitfield(1);
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
|
||||
MockGraphicsAllocation mockAllocation;
|
||||
mockAllocation.setAllocationType(AllocationType::kernelIsa);
|
||||
|
||||
csr.useNewResourceImplicitFlush = true;
|
||||
csr.newResources = false;
|
||||
csr.checkForNewResources(10u, GraphicsAllocation::objectNotUsed, mockAllocation);
|
||||
EXPECT_FALSE(csr.newResources);
|
||||
}
|
||||
|
||||
TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingAlreadyUsedAllocationTaskCountThenDoNotMarkNewResource) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
DeviceBitfield deviceBitfield(1);
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
|
||||
MockGraphicsAllocation mockAllocation;
|
||||
|
||||
csr.useNewResourceImplicitFlush = true;
|
||||
csr.newResources = false;
|
||||
csr.checkForNewResources(10u, 10u, mockAllocation);
|
||||
EXPECT_FALSE(csr.newResources);
|
||||
}
|
||||
|
||||
TEST(CommandStreamReceiverSimpleTest, givenNewResourceFlushEnabledWhenProvidingNewAllocationAndVerbosityEnabledThenProvidePrintOfNewAllocationType) {
|
||||
DebugManagerStateRestore restore;
|
||||
debugManager.flags.ProvideVerboseImplicitFlush.set(true);
|
||||
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
DeviceBitfield deviceBitfield(1);
|
||||
MockCommandStreamReceiver csr(executionEnvironment, 0, deviceBitfield);
|
||||
MockGraphicsAllocation mockAllocation;
|
||||
|
||||
csr.useNewResourceImplicitFlush = true;
|
||||
csr.newResources = false;
|
||||
testing::internal::CaptureStdout();
|
||||
csr.checkForNewResources(10u, GraphicsAllocation::objectNotUsed, mockAllocation);
|
||||
EXPECT_TRUE(csr.newResources);
|
||||
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
EXPECT_NE(0u, output.size());
|
||||
EXPECT_STREQ("New resource detected of type 0\n", output.c_str());
|
||||
}
|
||||
|
||||
TEST(CommandStreamReceiverSimpleTest, givenPrintfTagAllocationAddressFlagEnabledWhenCreatingTagAllocationThenPrintItsAddress) {
|
||||
DebugManagerStateRestore restore;
|
||||
debugManager.flags.PrintTagAllocationAddress.set(true);
|
||||
|
||||
Reference in New Issue
Block a user