From d6fb463f16e3cff621f9cad904513b8c905168e7 Mon Sep 17 00:00:00 2001 From: Mateusz Hoppe Date: Fri, 22 May 2020 15:28:11 +0200 Subject: [PATCH] Fix bug with allocationsForDownload - after downloading clear container Change-Id: If70e973a9366d2fc33d263bce3a3927e0c2f0531 Signed-off-by: Mateusz Hoppe --- .../source/command_stream/tbx_command_stream_receiver_hw.inl | 1 + .../unit_test/command_stream/tbx_command_stream_tests.cpp | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencl/source/command_stream/tbx_command_stream_receiver_hw.inl b/opencl/source/command_stream/tbx_command_stream_receiver_hw.inl index 8173afccb2..12306ba013 100644 --- a/opencl/source/command_stream/tbx_command_stream_receiver_hw.inl +++ b/opencl/source/command_stream/tbx_command_stream_receiver_hw.inl @@ -525,6 +525,7 @@ void TbxCommandStreamReceiverHw::downloadAllocations() { for (GraphicsAllocation *graphicsAllocation : this->allocationsForDownload) { downloadAllocation(*graphicsAllocation); } + this->allocationsForDownload.clear(); } template diff --git a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp index 8b9d47f7f9..4026a1c9af 100644 --- a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp +++ b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp @@ -446,7 +446,7 @@ HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenCallingWaitForCompletionWithT EXPECT_TRUE(tbxCsr.flushBatchedSubmissionsCalled); } -HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenDownloadAllocatoinsCalledThenTagAndScheduledAllocationsAreDownloadedButNotRemovedFromContainer) { +HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenDownloadAllocatoinsCalledThenTagAndScheduledAllocationsAreDownloadedAndRemovedFromContainer) { MockTbxCsrRegisterDownloadedAllocations tbxCsr{*pDevice->executionEnvironment, pDevice->getRootDeviceIndex()}; MockOsContext osContext(0, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false); uint32_t tag = 0u; @@ -459,8 +459,7 @@ HWTEST_F(TbxCommandSteamSimpleTest, givenTbxCsrWhenDownloadAllocatoinsCalledThen tbxCsr.downloadAllocations(); std::set expectedDownloadedAllocations = {tbxCsr.getTagAllocation(), &allocation1, &allocation2, &allocation3}; - EXPECT_EQ(expectedDownloadedAllocations, tbxCsr.downloadedAllocations); - EXPECT_EQ(3u, tbxCsr.allocationsForDownload.size()); + EXPECT_EQ(0u, tbxCsr.allocationsForDownload.size()); } HWTEST_F(TbxCommandSteamSimpleTest, whenTbxCommandStreamReceiverIsCreatedThenPPGTTAndGGTTCreatedHavePhysicalAddressAllocatorSet) {