From 32a5b955dd933cbf47e06d557aa178ca15d91ce9 Mon Sep 17 00:00:00 2001 From: Mateusz Hoppe Date: Fri, 17 Nov 2023 15:34:26 +0000 Subject: [PATCH] refactor: use cmdQ from fixture in aub test - do not allocate more cmdQs than necessary Signed-off-by: Mateusz Hoppe --- .../aub_postsync_write_tests_xehp_and_later.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/opencl/test/unit_test/aub_tests/command_queue/aub_postsync_write_tests_xehp_and_later.cpp b/opencl/test/unit_test/aub_tests/command_queue/aub_postsync_write_tests_xehp_and_later.cpp index 9fc354d093..afece60110 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/aub_postsync_write_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/aub_postsync_write_tests_xehp_and_later.cpp @@ -37,8 +37,6 @@ struct PostSyncWriteXeHPTests : public HelloWorldFixture cmdQ(pContext, pClDevice, nullptr); - const uint32_t bufferSize = 4; std::unique_ptr buffer(Buffer::create(pContext, CL_MEM_READ_WRITE, bufferSize, nullptr, retVal)); @@ -47,18 +45,16 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, PostSyncWriteXeHPTests, givenTimestampWriteEnabledW buffer->forceDisallowCPUCopy = true; uint8_t writeData[bufferSize] = {1, 2, 3, 4}; - cmdQ.enqueueWriteBuffer(buffer.get(), CL_TRUE, 0, bufferSize, writeData, nullptr, 0, nullptr, nullptr); + pCmdQ->enqueueWriteBuffer(buffer.get(), CL_TRUE, 0, bufferSize, writeData, nullptr, 0, nullptr, nullptr); expectMemory(reinterpret_cast(graphicsAllocation->getGpuAddress() + buffer->getOffset()), writeData, bufferSize); typename FamilyType::TimestampPacketType expectedTimestampValues[4] = {1, 1, 1, 1}; - auto tagGpuAddress = reinterpret_cast(cmdQ.timestampPacketContainer->peekNodes().at(0)->getGpuAddress()); + auto tagGpuAddress = reinterpret_cast(pCmdQ->getTimestampPacketContainer()->peekNodes().at(0)->getGpuAddress()); expectMemoryNotEqual(tagGpuAddress, expectedTimestampValues, 4 * sizeof(typename FamilyType::TimestampPacketType)); } HWCMDTEST_F(IGFX_XE_HP_CORE, PostSyncWriteXeHPTests, givenDebugVariableEnabledWhenEnqueueingThenWritePostsyncOperationInImmWriteMode) { DebugManager.flags.UseImmDataWriteModeOnPostSyncOperation.set(true); - MockCommandQueueHw cmdQ(pContext, pClDevice, nullptr); - const uint32_t bufferSize = 4; std::unique_ptr buffer(Buffer::create(pContext, CL_MEM_READ_WRITE, bufferSize, nullptr, retVal)); @@ -67,10 +63,10 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, PostSyncWriteXeHPTests, givenDebugVariableEnabledWh buffer->forceDisallowCPUCopy = true; uint8_t writeData[bufferSize] = {1, 2, 3, 4}; - cmdQ.enqueueWriteBuffer(buffer.get(), CL_TRUE, 0, bufferSize, writeData, nullptr, 0, nullptr, nullptr); + pCmdQ->enqueueWriteBuffer(buffer.get(), CL_TRUE, 0, bufferSize, writeData, nullptr, 0, nullptr, nullptr); expectMemory(reinterpret_cast(graphicsAllocation->getGpuAddress() + buffer->getOffset()), writeData, bufferSize); - auto tagGpuAddress = reinterpret_cast(cmdQ.timestampPacketContainer->peekNodes().at(0)->getGpuAddress()); + auto tagGpuAddress = reinterpret_cast(pCmdQ->getTimestampPacketContainer()->peekNodes().at(0)->getGpuAddress()); constexpr auto timestampPacketTypeSize = sizeof(typename FamilyType::TimestampPacketType); if constexpr (timestampPacketTypeSize == 4u) {