From f75c9e2f57242a8a8eb52aa9ee1faaf7aa456b7b Mon Sep 17 00:00:00 2001 From: Michal Mrozek Date: Thu, 24 Sep 2020 06:35:53 +0200 Subject: [PATCH] Make sure that implicit flush controls are disabled in AUB capture. Change-Id: Ie731b8f6f2ca322e8298e8e2f3ed633fe01f07fb Signed-off-by: Michal Mrozek --- ...mmand_stream_receiver_simulated_common_hw_base.inl | 5 ++++- .../aub_command_stream_receiver_1_tests.cpp | 11 +++++++++++ .../libult/ult_aub_command_stream_receiver.h | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/opencl/source/command_stream/command_stream_receiver_simulated_common_hw_base.inl b/opencl/source/command_stream/command_stream_receiver_simulated_common_hw_base.inl index c290af584e..e6ad23bef1 100644 --- a/opencl/source/command_stream/command_stream_receiver_simulated_common_hw_base.inl +++ b/opencl/source/command_stream/command_stream_receiver_simulated_common_hw_base.inl @@ -104,7 +104,10 @@ uint32_t CommandStreamReceiverSimulatedCommonHw::getDeviceIndex() con return osContext->getDeviceBitfield().any() ? static_cast(Math::log2(static_cast(osContext->getDeviceBitfield().to_ulong()))) : 0u; } template -CommandStreamReceiverSimulatedCommonHw::CommandStreamReceiverSimulatedCommonHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex) {} +CommandStreamReceiverSimulatedCommonHw::CommandStreamReceiverSimulatedCommonHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : CommandStreamReceiverHw(executionEnvironment, rootDeviceIndex) { + this->useNewResourceImplicitFlush = false; + this->useGpuIdleImplicitFlush = false; +} template CommandStreamReceiverSimulatedCommonHw::~CommandStreamReceiverSimulatedCommonHw() = default; } // namespace NEO diff --git a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp index dbdbfdf67d..2f90996152 100644 --- a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp @@ -1171,6 +1171,17 @@ HWTEST_F(AubCommandStreamReceiverTests, WhenBlitBufferIsCalledThenCounterIsCorre EXPECT_EQ(1u, aubCsr->blitBufferCalled); } +HWTEST_F(AubCommandStreamReceiverTests, givenDebugOverwritesForImplicitFlushesWhenTheyAreUsedTheyDoNotAffectAubCapture) { + DebugManagerStateRestore restorer; + DebugManager.flags.PerformImplicitFlushForIdleGpu.set(1); + DebugManager.flags.PerformImplicitFlushForNewResource.set(1); + + auto aubExecutionEnvironment = getEnvironment>(true, true, true); + auto aubCsr = aubExecutionEnvironment->template getCsr>(); + EXPECT_FALSE(aubCsr->useGpuIdleImplicitFlush); + EXPECT_FALSE(aubCsr->useNewResourceImplicitFlush); +} + using HardwareContextContainerTests = ::testing::Test; TEST_F(HardwareContextContainerTests, givenOsContextWithMultipleDevicesSupportedThenInitialzeHwContextsWithValidIndexes) { diff --git a/opencl/test/unit_test/libult/ult_aub_command_stream_receiver.h b/opencl/test/unit_test/libult/ult_aub_command_stream_receiver.h index 92c4fbffb0..1bd6d064cb 100644 --- a/opencl/test/unit_test/libult/ult_aub_command_stream_receiver.h +++ b/opencl/test/unit_test/libult/ult_aub_command_stream_receiver.h @@ -20,6 +20,8 @@ class UltAubCommandStreamReceiver : public AUBCommandStreamReceiverHw public: using BaseClass::osContext; + using BaseClass::useGpuIdleImplicitFlush; + using BaseClass::useNewResourceImplicitFlush; UltAubCommandStreamReceiver(const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : BaseClass(fileName, standalone, executionEnvironment, rootDeviceIndex) {