diff --git a/level_zero/core/source/cmdqueue/cmdqueue.cpp b/level_zero/core/source/cmdqueue/cmdqueue.cpp index 611d042e5b..7dd627496b 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue.cpp +++ b/level_zero/core/source/cmdqueue/cmdqueue.cpp @@ -55,10 +55,9 @@ ze_result_t CommandQueueImp::initialize(bool copyOnly, bool isInternal) { if (returnValue == ZE_RESULT_SUCCESS) { NEO::GraphicsAllocation *bufferAllocation = buffers.getCurrentBufferAllocation(); UNRECOVERABLE_IF(bufferAllocation == nullptr); - commandStream = new NEO::LinearStream(bufferAllocation->getUnderlyingBuffer(), - defaultQueueCmdBufferSize); - UNRECOVERABLE_IF(commandStream == nullptr); - commandStream->replaceGraphicsAllocation(bufferAllocation); + commandStream.replaceBuffer(bufferAllocation->getUnderlyingBuffer(), + defaultQueueCmdBufferSize); + commandStream.replaceGraphicsAllocation(bufferAllocation); isCopyOnlyCommandQueue = copyOnly; preemptionCmdSyncProgramming = getPreemptionCmdProgramming(); activeSubDevices = static_cast(csr->getOsContext().getDeviceBitfield().count()); @@ -75,14 +74,13 @@ ze_result_t CommandQueueImp::initialize(bool copyOnly, bool isInternal) { NEO::WaitStatus CommandQueueImp::reserveLinearStreamSize(size_t size) { auto waitStatus{NEO::WaitStatus::Ready}; - UNRECOVERABLE_IF(commandStream == nullptr); - if (commandStream->getAvailableSpace() < size) { + if (commandStream.getAvailableSpace() < size) { waitStatus = buffers.switchBuffers(csr); NEO::GraphicsAllocation *nextBufferAllocation = buffers.getCurrentBufferAllocation(); - commandStream->replaceBuffer(nextBufferAllocation->getUnderlyingBuffer(), - defaultQueueCmdBufferSize); - commandStream->replaceGraphicsAllocation(nextBufferAllocation); + commandStream.replaceBuffer(nextBufferAllocation->getUnderlyingBuffer(), + defaultQueueCmdBufferSize); + commandStream.replaceGraphicsAllocation(nextBufferAllocation); } return waitStatus; @@ -92,18 +90,18 @@ NEO::SubmissionStatus CommandQueueImp::submitBatchBuffer(size_t offset, NEO::Res bool isCooperative) { UNRECOVERABLE_IF(csr == nullptr); - NEO::BatchBuffer batchBuffer(commandStream->getGraphicsAllocation(), offset, 0u, nullptr, false, false, + NEO::BatchBuffer batchBuffer(commandStream.getGraphicsAllocation(), offset, 0u, nullptr, false, false, NEO::QueueThrottle::HIGH, NEO::QueueSliceCount::defaultSliceCount, - commandStream->getUsed(), commandStream, endingCmdPtr, isCooperative); + commandStream.getUsed(), &commandStream, endingCmdPtr, isCooperative); - commandStream->getGraphicsAllocation()->updateTaskCount(csr->peekTaskCount() + 1, csr->getOsContext().getContextId()); - commandStream->getGraphicsAllocation()->updateResidencyTaskCount(csr->peekTaskCount() + 1, csr->getOsContext().getContextId()); + commandStream.getGraphicsAllocation()->updateTaskCount(csr->peekTaskCount() + 1, csr->getOsContext().getContextId()); + commandStream.getGraphicsAllocation()->updateResidencyTaskCount(csr->peekTaskCount() + 1, csr->getOsContext().getContextId()); csr->setActivePartitions(partitionCount); auto ret = csr->submitBatchBuffer(batchBuffer, csr->getResidencyAllocations()); if (ret != NEO::SubmissionStatus::SUCCESS) { - commandStream->getGraphicsAllocation()->updateTaskCount(csr->peekTaskCount(), csr->getOsContext().getContextId()); - commandStream->getGraphicsAllocation()->updateResidencyTaskCount(csr->peekTaskCount(), csr->getOsContext().getContextId()); + commandStream.getGraphicsAllocation()->updateTaskCount(csr->peekTaskCount(), csr->getOsContext().getContextId()); + commandStream.getGraphicsAllocation()->updateResidencyTaskCount(csr->peekTaskCount(), csr->getOsContext().getContextId()); return ret; } diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl index 5010037f1b..3d52594796 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl @@ -58,9 +58,9 @@ ze_result_t CommandQueueHw::createFence(const ze_fence_desc_t *de template ze_result_t CommandQueueHw::destroy() { - if (commandStream) { - delete commandStream; - commandStream = nullptr; + if (commandStream.getCpuBase() != nullptr) { + commandStream.replaceGraphicsAllocation(nullptr); + commandStream.replaceBuffer(nullptr, 0); } buffers.destroy(this->getDevice()); if (NEO::Debugger::isDebugEnabled(internalUsage) && device->getL0Debugger()) { @@ -659,8 +659,8 @@ ze_result_t CommandQueueHw::makeAlignedChildStreamAndSetGpuBase(N return ZE_RESULT_ERROR_DEVICE_LOST; } - child.replaceBuffer(this->commandStream->getSpace(alignedSize), alignedSize); - child.setGpuBase(ptrOffset(this->commandStream->getGpuBase(), this->commandStream->getUsed() - alignedSize)); + child.replaceBuffer(this->commandStream.getSpace(alignedSize), alignedSize); + child.setGpuBase(ptrOffset(this->commandStream.getGpuBase(), this->commandStream.getUsed() - alignedSize)); this->alignedChildStreamPadding = alignedSize - requiredSize; return ZE_RESULT_SUCCESS; } @@ -1001,7 +1001,7 @@ NEO::SubmissionStatus CommandQueueHw::prepareAndSubmitBatchBuffer using MI_BATCH_BUFFER_END = typename GfxFamily::MI_BATCH_BUFFER_END; - auto &outerCommandStream = *this->commandStream; + auto &outerCommandStream = this->commandStream; void *endingCmd = nullptr; if (ctx.isDirectSubmissionEnabled) { diff --git a/level_zero/core/source/cmdqueue/cmdqueue_imp.h b/level_zero/core/source/cmdqueue/cmdqueue_imp.h index 7a3852af22..b4d137dd69 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_imp.h +++ b/level_zero/core/source/cmdqueue/cmdqueue_imp.h @@ -8,6 +8,7 @@ #pragma once #include "shared/source/command_container/cmdcontainer.h" +#include "shared/source/command_stream/linear_stream.h" #include "shared/source/command_stream/submission_status.h" #include "shared/source/command_stream/wait_status.h" #include "shared/source/helpers/completion_stamp.h" @@ -98,7 +99,7 @@ struct CommandQueueImp : public CommandQueue { Device *device = nullptr; NEO::CommandStreamReceiver *csr = nullptr; - NEO::LinearStream *commandStream = nullptr; + NEO::LinearStream commandStream{}; std::atomic taskCount{0}; diff --git a/level_zero/core/test/unit_tests/gen11/test_cmdqueue_thread_arbitration_policy_gen11.cpp b/level_zero/core/test/unit_tests/gen11/test_cmdqueue_thread_arbitration_policy_gen11.cpp index 8415ee0893..ce32ad499d 100644 --- a/level_zero/core/test/unit_tests/gen11/test_cmdqueue_thread_arbitration_policy_gen11.cpp +++ b/level_zero/core/test/unit_tests/gen11/test_cmdqueue_thread_arbitration_policy_gen11.cpp @@ -55,7 +55,7 @@ struct CommandQueueThreadArbitrationPolicyTests : public ::testing::Test { false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); commandList = CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue); ASSERT_NE(nullptr, commandList); @@ -77,18 +77,18 @@ struct CommandQueueThreadArbitrationPolicyTests : public ::testing::Test { HWTEST2_F(CommandQueueThreadArbitrationPolicyTests, whenCommandListIsExecutedThenDefaultRoundRobinThreadArbitrationPolicyIsUsed, IsGen11HP) { - size_t usedSpaceBefore = commandQueue->commandStream->getUsed(); + size_t usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t hCommandList = commandList->toHandle(); auto result = commandQueue->executeCommandLists(1, &hCommandList, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - size_t usedSpaceAfter = commandQueue->commandStream->getUsed(); + size_t usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); @@ -108,18 +108,18 @@ HWTEST2_F(CommandQueueThreadArbitrationPolicyTests, IsGen11HP) { DebugManager.flags.OverrideThreadArbitrationPolicy.set(0); - size_t usedSpaceBefore = commandQueue->commandStream->getUsed(); + size_t usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t hCommandList = commandList->toHandle(); auto result = commandQueue->executeCommandLists(1, &hCommandList, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - size_t usedSpaceAfter = commandQueue->commandStream->getUsed(); + size_t usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); @@ -139,18 +139,18 @@ HWTEST2_F(CommandQueueThreadArbitrationPolicyTests, IsGen11HP) { DebugManager.flags.OverrideThreadArbitrationPolicy.set(1); - size_t usedSpaceBefore = commandQueue->commandStream->getUsed(); + size_t usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t hCommandList = commandList->toHandle(); auto result = commandQueue->executeCommandLists(1, &hCommandList, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - size_t usedSpaceAfter = commandQueue->commandStream->getUsed(); + size_t usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); diff --git a/level_zero/core/test/unit_tests/gen9/test_cmdqueue_enqueuecommandlist_gen9.cpp b/level_zero/core/test/unit_tests/gen9/test_cmdqueue_enqueuecommandlist_gen9.cpp index 736a387ea2..13b5d6daaf 100644 --- a/level_zero/core/test/unit_tests/gen9/test_cmdqueue_enqueuecommandlist_gen9.cpp +++ b/level_zero/core/test/unit_tests/gen9/test_cmdqueue_enqueuecommandlist_gen9.cpp @@ -36,8 +36,8 @@ GEN9TEST_F(CommandQueueExecuteCommandListsGen9, WhenExecutingCmdListsThenPipelin auto commandQueue = whiteboxCast(CommandQueue::create( productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &desc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + ASSERT_NE(nullptr, commandQueue); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -46,12 +46,12 @@ GEN9TEST_F(CommandQueueExecuteCommandListsGen9, WhenExecutingCmdListsThenPipelin ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using MEDIA_VFE_STATE = typename FamilyType::MEDIA_VFE_STATE; auto itorVFE = find(cmdList.begin(), cmdList.end()); @@ -77,8 +77,8 @@ GEN9TEST_F(CommandQueueExecuteCommandListsGen9, WhenExecutingCmdListsThenStateBa auto commandQueue = whiteboxCast(CommandQueue::create( productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &desc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + ASSERT_NE(nullptr, commandQueue); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -87,12 +87,12 @@ GEN9TEST_F(CommandQueueExecuteCommandListsGen9, WhenExecutingCmdListsThenStateBa ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; auto itorSba = find(cmdList.begin(), cmdList.end()); @@ -125,8 +125,8 @@ GEN9TEST_F(CommandQueueExecuteCommandListsGen9, WhenExecutingCmdListsThenMidThre auto commandQueue = whiteboxCast(CommandQueue::create( productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &desc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + ASSERT_NE(nullptr, commandQueue); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto commandList = whiteboxCast(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)); commandList->commandListPreemptionMode = NEO::PreemptionMode::MidThread; @@ -138,12 +138,12 @@ GEN9TEST_F(CommandQueueExecuteCommandListsGen9, WhenExecutingCmdListsThenMidThre ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using STATE_SIP = typename FamilyType::STATE_SIP; using GPGPU_CSR_BASE_ADDRESS = typename FamilyType::GPGPU_CSR_BASE_ADDRESS; using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; @@ -172,8 +172,8 @@ GEN9TEST_F(CommandQueueExecuteCommandListsGen9, GivenCmdListsWithDifferentPreemp auto commandQueue = whiteboxCast(CommandQueue::create( productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &desc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + ASSERT_NE(nullptr, commandQueue); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto commandListMidThread = whiteboxCast(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)); commandListMidThread->commandListPreemptionMode = NEO::PreemptionMode::MidThread; @@ -189,12 +189,12 @@ GEN9TEST_F(CommandQueueExecuteCommandListsGen9, GivenCmdListsWithDifferentPreemp ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, commandQueue->commandStream->getCpuBase(), usedSpaceAfter)); + cmdList, commandQueue->commandStream.getCpuBase(), usedSpaceAfter)); using STATE_SIP = typename FamilyType::STATE_SIP; using GPGPU_CSR_BASE_ADDRESS = typename FamilyType::GPGPU_CSR_BASE_ADDRESS; using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; diff --git a/level_zero/core/test/unit_tests/gen9/test_cmdqueue_gen9.cpp b/level_zero/core/test/unit_tests/gen9/test_cmdqueue_gen9.cpp index 6fbeaebb2b..e9c641bafa 100644 --- a/level_zero/core/test/unit_tests/gen9/test_cmdqueue_gen9.cpp +++ b/level_zero/core/test/unit_tests/gen9/test_cmdqueue_gen9.cpp @@ -57,7 +57,7 @@ struct CommandQueueThreadArbitrationPolicyTests : public ::testing::Test { false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); commandList = CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue); ASSERT_NE(nullptr, commandList); @@ -79,18 +79,18 @@ struct CommandQueueThreadArbitrationPolicyTests : public ::testing::Test { HWTEST2_F(CommandQueueThreadArbitrationPolicyTests, whenCommandListIsExecutedThenDefaultRoundRobinThreadArbitrationPolicyIsUsed, IsGen9) { - size_t usedSpaceBefore = commandQueue->commandStream->getUsed(); + size_t usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t hCommandList = commandList->toHandle(); auto result = commandQueue->executeCommandLists(1, &hCommandList, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - size_t usedSpaceAfter = commandQueue->commandStream->getUsed(); + size_t usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); @@ -110,18 +110,18 @@ HWTEST2_F(CommandQueueThreadArbitrationPolicyTests, IsGen9) { DebugManager.flags.OverrideThreadArbitrationPolicy.set(0); - size_t usedSpaceBefore = commandQueue->commandStream->getUsed(); + size_t usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t hCommandList = commandList->toHandle(); auto result = commandQueue->executeCommandLists(1, &hCommandList, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - size_t usedSpaceAfter = commandQueue->commandStream->getUsed(); + size_t usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); @@ -141,18 +141,18 @@ HWTEST2_F(CommandQueueThreadArbitrationPolicyTests, IsGen9) { DebugManager.flags.OverrideThreadArbitrationPolicy.set(1); - size_t usedSpaceBefore = commandQueue->commandStream->getUsed(); + size_t usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t hCommandList = commandList->toHandle(); auto result = commandQueue->executeCommandLists(1, &hCommandList, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - size_t usedSpaceAfter = commandQueue->commandStream->getUsed(); + size_t usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_7.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_7.cpp index a483d5ea67..c8073a2778 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_7.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_7.cpp @@ -938,7 +938,7 @@ HWTEST2_F(MultiReturnCommandListTest, EXPECT_EQ(3u, cmdListBuffers.size()); - auto &cmdQueueStream = *commandQueue->commandStream; + auto &cmdQueueStream = commandQueue->commandStream; size_t usedBefore = cmdQueueStream.getUsed(); auto cmdListHandle = commandList->toHandle(); @@ -1186,7 +1186,7 @@ HWTEST2_F(MultiReturnCommandListTest, EXPECT_EQ(3u, cmdListBuffers.size()); - auto &cmdQueueStream = *commandQueue->commandStream; + auto &cmdQueueStream = commandQueue->commandStream; size_t usedBefore = cmdQueueStream.getUsed(); auto cmdListHandle = commandList->toHandle(); diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp index 1476461072..92ebcb1978 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp @@ -43,10 +43,10 @@ TEST_F(CommandQueueCreate, whenCreatingCommandQueueThenItIsInitialized) { ASSERT_NE(nullptr, commandQueue); size_t commandStreamSize = MemoryConstants::kiloByte * 128u; - ASSERT_NE(nullptr, commandQueue->commandStream); - EXPECT_EQ(commandStreamSize, commandQueue->commandStream->getMaxAvailableSpace()); - EXPECT_EQ(commandQueue->buffers.getCurrentBufferAllocation(), commandQueue->commandStream->getGraphicsAllocation()); - EXPECT_LT(0u, commandQueue->commandStream->getAvailableSpace()); + ASSERT_NE(nullptr, commandQueue); + EXPECT_EQ(commandStreamSize, commandQueue->commandStream.getMaxAvailableSpace()); + EXPECT_EQ(commandQueue->buffers.getCurrentBufferAllocation(), commandQueue->commandStream.getGraphicsAllocation()); + EXPECT_LT(0u, commandQueue->commandStream.getAvailableSpace()); EXPECT_EQ(csr.get(), commandQueue->getCsr()); EXPECT_EQ(device, commandQueue->getDevice()); @@ -101,9 +101,9 @@ HWTEST_F(CommandQueueCreate, givenGpuHangOnSecondReserveWhenReservingLinearStrea false, returnValue)); - size_t maxSize = commandQueue->commandStream->getMaxAvailableSpace(); + size_t maxSize = commandQueue->commandStream.getMaxAvailableSpace(); - auto firstAllocation = commandQueue->commandStream->getGraphicsAllocation(); + auto firstAllocation = commandQueue->commandStream.getGraphicsAllocation(); EXPECT_EQ(firstAllocation, commandQueue->buffers.getCurrentBufferAllocation()); uint32_t currentTaskCount = 33u; @@ -111,7 +111,7 @@ HWTEST_F(CommandQueueCreate, givenGpuHangOnSecondReserveWhenReservingLinearStrea csr.latestWaitForCompletionWithTimeoutTaskCount = currentTaskCount; csr.waitForTaskCountWithKmdNotifyFallbackReturnValue = WaitStatus::Ready; - commandQueue->commandStream->getSpace(maxSize - 16u); + commandQueue->commandStream.getSpace(maxSize - 16u); commandQueue->buffers.setCurrentFlushStamp(121u, 121u); size_t nextSize = 32u; @@ -119,7 +119,7 @@ HWTEST_F(CommandQueueCreate, givenGpuHangOnSecondReserveWhenReservingLinearStrea EXPECT_EQ(NEO::WaitStatus::Ready, waitStatus); csr.waitForTaskCountWithKmdNotifyFallbackReturnValue = WaitStatus::GpuHang; - commandQueue->commandStream->getSpace(maxSize - 32u); + commandQueue->commandStream.getSpace(maxSize - 32u); commandQueue->buffers.setCurrentFlushStamp(128u, 128u); nextSize = 64u; @@ -142,45 +142,45 @@ HWTEST_F(CommandQueueCreate, whenReserveLinearStreamThenBufferAllocationSwitched false, returnValue)); - size_t maxSize = commandQueue->commandStream->getMaxAvailableSpace(); + size_t maxSize = commandQueue->commandStream.getMaxAvailableSpace(); - auto firstAllocation = commandQueue->commandStream->getGraphicsAllocation(); + auto firstAllocation = commandQueue->commandStream.getGraphicsAllocation(); EXPECT_EQ(firstAllocation, commandQueue->buffers.getCurrentBufferAllocation()); uint32_t currentTaskCount = 33u; auto &csr = neoDevice->getUltCommandStreamReceiver(); csr.latestWaitForCompletionWithTimeoutTaskCount = currentTaskCount; - commandQueue->commandStream->getSpace(maxSize - 16u); + commandQueue->commandStream.getSpace(maxSize - 16u); commandQueue->buffers.setCurrentFlushStamp(121u, 121u); size_t nextSize = 16u + 16u; waitStatus = commandQueue->reserveLinearStreamSize(nextSize); EXPECT_EQ(NEO::WaitStatus::Ready, waitStatus); - auto secondAllocation = commandQueue->commandStream->getGraphicsAllocation(); + auto secondAllocation = commandQueue->commandStream.getGraphicsAllocation(); EXPECT_EQ(secondAllocation, commandQueue->buffers.getCurrentBufferAllocation()); EXPECT_NE(firstAllocation, secondAllocation); EXPECT_EQ(csr.latestWaitForCompletionWithTimeoutTaskCount, currentTaskCount); - commandQueue->commandStream->getSpace(maxSize - 16u); + commandQueue->commandStream.getSpace(maxSize - 16u); commandQueue->buffers.setCurrentFlushStamp(244u, 244u); waitStatus = commandQueue->reserveLinearStreamSize(nextSize); EXPECT_EQ(NEO::WaitStatus::Ready, waitStatus); - auto thirdAllocation = commandQueue->commandStream->getGraphicsAllocation(); + auto thirdAllocation = commandQueue->commandStream.getGraphicsAllocation(); EXPECT_EQ(thirdAllocation, commandQueue->buffers.getCurrentBufferAllocation()); EXPECT_EQ(thirdAllocation, firstAllocation); EXPECT_NE(thirdAllocation, secondAllocation); EXPECT_EQ(csr.latestWaitForCompletionWithTimeoutTaskCount, 121u); - commandQueue->commandStream->getSpace(maxSize - 16u); + commandQueue->commandStream.getSpace(maxSize - 16u); waitStatus = commandQueue->reserveLinearStreamSize(nextSize); EXPECT_EQ(NEO::WaitStatus::Ready, waitStatus); - auto fourthAllocation = commandQueue->commandStream->getGraphicsAllocation(); + auto fourthAllocation = commandQueue->commandStream.getGraphicsAllocation(); EXPECT_EQ(fourthAllocation, commandQueue->buffers.getCurrentBufferAllocation()); EXPECT_EQ(fourthAllocation, secondAllocation); EXPECT_NE(fourthAllocation, firstAllocation); @@ -216,12 +216,12 @@ TEST_F(CommandQueueCreate, whenCmdBuffersAllocationsAreCreatedThenSizeIsNotLessT false, returnValue)); - size_t maxSize = commandQueue->commandStream->getMaxAvailableSpace(); + size_t maxSize = commandQueue->commandStream.getMaxAvailableSpace(); auto sizeFirstBuffer = commandQueue->buffers.getCurrentBufferAllocation()->getUnderlyingBufferSize(); EXPECT_LE(maxSize, sizeFirstBuffer); - commandQueue->commandStream->getSpace(maxSize - 16u); + commandQueue->commandStream.getSpace(maxSize - 16u); size_t nextSize = 16u + 16u; const auto waitStatus = commandQueue->reserveLinearStreamSize(nextSize); @@ -265,9 +265,9 @@ HWTEST_F(CommandQueueCreate, given100CmdListsWhenExecutingThenCommandStreamIsNot cmdListHandles[i] = commandList->toHandle(); } - auto sizeBefore = commandQueue->commandStream->getUsed(); + auto sizeBefore = commandQueue->commandStream.getUsed(); commandQueue->executeCommandLists(numHandles, cmdListHandles, nullptr, false); - auto sizeAfter = commandQueue->commandStream->getUsed(); + auto sizeAfter = commandQueue->commandStream.getUsed(); EXPECT_LT(sizeBefore, sizeAfter); size_t streamSizeMinimum = @@ -389,9 +389,9 @@ HWTEST2_F(CommandQueueCreate, givenSwTagsEnabledWhenPrepareAndSubmitBatchBufferT auto &commandStream = commandQueue->commandStream; auto estimatedSize = 4096u; - NEO::LinearStream linearStream(commandStream->getSpace(estimatedSize), estimatedSize); + NEO::LinearStream linearStream(commandStream.getSpace(estimatedSize), estimatedSize); // fill with random data - memset(commandStream->getCpuBase(), 0xD, estimatedSize); + memset(commandStream.getCpuBase(), 0xD, estimatedSize); typename MockCommandQueueHw::CommandListExecutionContext ctx{}; commandQueue->prepareAndSubmitBatchBuffer(ctx, linearStream); @@ -400,7 +400,7 @@ HWTEST2_F(CommandQueueCreate, givenSwTagsEnabledWhenPrepareAndSubmitBatchBufferT auto offsetInBytes = sizeof(typename FamilyType::MI_BATCH_BUFFER_END); auto isLeftoverZeroed = true; for (auto i = offsetInBytes; i < estimatedSize; i++) { - uint8_t *data = reinterpret_cast(commandStream->getCpuBase()); + uint8_t *data = reinterpret_cast(commandStream.getCpuBase()); if (data[i] != 0) { isLeftoverZeroed = false; break; @@ -480,7 +480,7 @@ HWTEST_F(CommandQueueCreate, givenUpdateTaskCountFromWaitAndRegularCmdListWhenDi GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), commandQueue->commandStream->getUsed())); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), commandQueue->commandStream.getUsed())); auto pipeControls = findAll(cmdList.begin(), cmdList.end()); bool pipeControlsPostSync = false; @@ -520,7 +520,7 @@ HWTEST_F(CommandQueueCreate, givenUpdateTaskCountFromWaitAndImmediateCmdListWhen GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), commandQueue->commandStream->getUsed())); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), commandQueue->commandStream.getUsed())); auto pipeControls = findAll(cmdList.begin(), cmdList.end()); bool pipeControlsPostSync = false; @@ -556,8 +556,8 @@ HWTEST_F(CommandQueueCreate, givenContainerWithAllocationsWhenResidencyContainer EXPECT_EQ(ret, NEO::SubmissionStatus::SUCCESS); EXPECT_EQ((peekTaskCountBefore + 1), commandQueue->csr->peekTaskCount()); EXPECT_EQ((flushedTaskCountBefore + 1), commandQueue->csr->peekLatestFlushedTaskCount()); - EXPECT_EQ(commandQueue->commandStream->getGraphicsAllocation()->getTaskCount(commandQueue->csr->getOsContext().getContextId()), commandQueue->csr->peekTaskCount()); - EXPECT_EQ(commandQueue->commandStream->getGraphicsAllocation()->getResidencyTaskCount(commandQueue->csr->getOsContext().getContextId()), commandQueue->csr->peekTaskCount()); + EXPECT_EQ(commandQueue->commandStream.getGraphicsAllocation()->getTaskCount(commandQueue->csr->getOsContext().getContextId()), commandQueue->csr->peekTaskCount()); + EXPECT_EQ(commandQueue->commandStream.getGraphicsAllocation()->getResidencyTaskCount(commandQueue->csr->getOsContext().getContextId()), commandQueue->csr->peekTaskCount()); commandQueue->destroy(); } @@ -580,8 +580,8 @@ HWTEST_F(CommandQueueCreate, givenCommandStreamReceiverFailsThenSubmitBatchBuffe EXPECT_EQ(ret, NEO::SubmissionStatus::FAILED); EXPECT_EQ(peekTaskCountBefore, commandQueue->csr->peekTaskCount()); EXPECT_EQ(flushedTaskCountBefore, commandQueue->csr->peekLatestFlushedTaskCount()); - EXPECT_EQ(commandQueue->commandStream->getGraphicsAllocation()->getTaskCount(commandQueue->csr->getOsContext().getContextId()), commandQueue->csr->peekTaskCount()); - EXPECT_EQ(commandQueue->commandStream->getGraphicsAllocation()->getResidencyTaskCount(commandQueue->csr->getOsContext().getContextId()), commandQueue->csr->peekTaskCount()); + EXPECT_EQ(commandQueue->commandStream.getGraphicsAllocation()->getTaskCount(commandQueue->csr->getOsContext().getContextId()), commandQueue->csr->peekTaskCount()); + EXPECT_EQ(commandQueue->commandStream.getGraphicsAllocation()->getResidencyTaskCount(commandQueue->csr->getOsContext().getContextId()), commandQueue->csr->peekTaskCount()); commandQueue->destroy(); } @@ -618,7 +618,7 @@ TEST_F(CommandQueueCreate, whenCommandQueueCreatedThenExpectLinearStreamInitiali ASSERT_NE(commandQueue, nullptr); size_t commandStreamSize = MemoryConstants::kiloByte * 128u; - EXPECT_EQ(commandStreamSize, commandQueue->commandStream->getMaxAvailableSpace()); + EXPECT_EQ(commandStreamSize, commandQueue->commandStream.getMaxAvailableSpace()); size_t expectedCommandBufferAllocationSize = commandStreamSize + MemoryConstants::cacheLineSize + NEO::CSRequirements::csOverfetchSize; expectedCommandBufferAllocationSize = alignUp(expectedCommandBufferAllocationSize, MemoryConstants::pageSize64k); @@ -1274,16 +1274,16 @@ HWTEST2_F(ExecuteCommandListTests, givenCommandQueueHavingTwoB2BCommandListsThen auto commandListHandle0 = commandList0->toHandle(); auto commandListHandle1 = commandList1->toHandle(); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); commandQueue->executeCommandLists(1, &commandListHandle0, nullptr, false); commandQueue->executeCommandLists(1, &commandListHandle1, nullptr, false); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList1; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList1, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList1, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto mediaVfeStates = findAll(cmdList1.begin(), cmdList1.end()); auto gsbaStates = findAll(cmdList1.begin(), cmdList1.end()); @@ -1320,11 +1320,11 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists commandQueue->executeCommandLists(1, &commandListHandle1, nullptr, false); EXPECT_EQ(512u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize()); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto mediaVfeStates = findAll(cmdList.begin(), cmdList.end()); auto gsbaStates = findAll(cmdList.begin(), cmdList.end()); @@ -1350,11 +1350,11 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists commandQueue1->executeCommandLists(1, &commandListHandle1, nullptr, false); EXPECT_EQ(512u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize()); - usedSpaceAfter = commandQueue1->commandStream->getUsed(); + usedSpaceAfter = commandQueue1->commandStream.getUsed(); GenCmdList cmdList1; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList1, ptrOffset(commandQueue1->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList1, ptrOffset(commandQueue1->commandStream.getCpuBase(), 0), usedSpaceAfter)); mediaVfeStates = findAll(cmdList1.begin(), cmdList1.end()); gsbaStates = findAll(cmdList1.begin(), cmdList1.end()); @@ -1392,11 +1392,11 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists commandQueue->executeCommandLists(1, &commandListHandle1, nullptr, false); EXPECT_EQ(512u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize()); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto mediaVfeStates = findAll(cmdList.begin(), cmdList.end()); auto gsbaStates = findAll(cmdList.begin(), cmdList.end()); @@ -1422,11 +1422,11 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists commandQueue1->executeCommandLists(1, &commandListHandle1, nullptr, false); EXPECT_EQ(512u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize()); - usedSpaceAfter = commandQueue1->commandStream->getUsed(); + usedSpaceAfter = commandQueue1->commandStream.getUsed(); GenCmdList cmdList1; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList1, ptrOffset(commandQueue1->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList1, ptrOffset(commandQueue1->commandStream.getCpuBase(), 0), usedSpaceAfter)); mediaVfeStates = findAll(cmdList1.begin(), cmdList1.end()); gsbaStates = findAll(cmdList1.begin(), cmdList1.end()); @@ -1464,11 +1464,11 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists commandQueue->executeCommandLists(1, &commandListHandle1, nullptr, false); EXPECT_EQ(512u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize()); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto mediaVfeStates = findAll(cmdList.begin(), cmdList.end()); auto gsbaStates = findAll(cmdList.begin(), cmdList.end()); @@ -1494,11 +1494,11 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists commandQueue1->executeCommandLists(1, &commandListHandle1, nullptr, false); EXPECT_EQ(1024u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize()); - usedSpaceAfter = commandQueue1->commandStream->getUsed(); + usedSpaceAfter = commandQueue1->commandStream.getUsed(); GenCmdList cmdList1; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList1, ptrOffset(commandQueue1->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList1, ptrOffset(commandQueue1->commandStream.getCpuBase(), 0), usedSpaceAfter)); mediaVfeStates = findAll(cmdList1.begin(), cmdList1.end()); gsbaStates = findAll(cmdList1.begin(), cmdList1.end()); @@ -1536,11 +1536,11 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists commandQueue->executeCommandLists(1, &commandListHandle1, nullptr, false); EXPECT_EQ(512u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize()); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto mediaVfeStates = findAll(cmdList.begin(), cmdList.end()); auto gsbaStates = findAll(cmdList.begin(), cmdList.end()); @@ -1565,11 +1565,11 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists commandQueue1->executeCommandLists(1, &commandListHandle1, nullptr, false); EXPECT_EQ(2048u, csr->getScratchSpaceController()->getPerThreadScratchSpaceSize()); - usedSpaceAfter = commandQueue1->commandStream->getUsed(); + usedSpaceAfter = commandQueue1->commandStream.getUsed(); GenCmdList cmdList1; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList1, ptrOffset(commandQueue1->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList1, ptrOffset(commandQueue1->commandStream.getCpuBase(), 0), usedSpaceAfter)); mediaVfeStates = findAll(cmdList1.begin(), cmdList1.end()); gsbaStates = findAll(cmdList1.begin(), cmdList1.end()); @@ -1606,11 +1606,11 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists commandQueue->executeCommandLists(1, &commandListHandle1, nullptr, false); EXPECT_EQ(512u, csr->getScratchSpaceController()->getPerThreadPrivateScratchSize()); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto mediaVfeStates = findAll(cmdList.begin(), cmdList.end()); @@ -1633,11 +1633,11 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists commandQueue1->executeCommandLists(1, &commandListHandle1, nullptr, false); EXPECT_EQ(2048u, csr->getScratchSpaceController()->getPerThreadPrivateScratchSize()); - usedSpaceAfter = commandQueue1->commandStream->getUsed(); + usedSpaceAfter = commandQueue1->commandStream.getUsed(); GenCmdList cmdList1; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList1, ptrOffset(commandQueue1->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList1, ptrOffset(commandQueue1->commandStream.getCpuBase(), 0), usedSpaceAfter)); mediaVfeStates = findAll(cmdList1.begin(), cmdList1.end()); @@ -1667,11 +1667,11 @@ HWTEST_F(ExecuteCommandListTests, givenDirectSubmissionEnabledWhenExecutingCmdLi commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto bbStartCmds = findAll(cmdList.begin(), cmdList.end()); @@ -1709,11 +1709,11 @@ HWTEST_F(ExecuteCommandListTests, givenDirectSubmissionEnabledAndDebugFlagSetWhe commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto bbStartCmds = findAll(cmdList.begin(), cmdList.end()); diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp index 4a24609927..4de8015b7a 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp @@ -470,12 +470,12 @@ HWTEST_F(CommandQueueSynchronizeTest, givenSynchronousCommandQueueWhenTagUpdateF returnValue = commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, false); EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); returnValue = commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, false); EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); size_t executionConsumedSize = usedSpaceAfter - usedSpaceBefore; @@ -484,7 +484,7 @@ HWTEST_F(CommandQueueSynchronizeTest, givenSynchronousCommandQueueWhenTagUpdateF GenCmdList cmdList; ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, - ptrOffset(commandQueue->commandStream->getCpuBase(), usedSpaceBefore), + ptrOffset(commandQueue->commandStream.getCpuBase(), usedSpaceBefore), executionConsumedSize)); auto pipeControls = findAll(cmdList.begin(), cmdList.end()); @@ -751,22 +751,22 @@ HWTEST2_F(DeviceWithDualStorage, givenCmdListWithAppendedKernelAndUsmTransferAnd auto deviceImp = static_cast(device); auto pageFaultCmdQueue = whiteboxCast(deviceImp->pageFaultCommandList->cmdQImmediate); - auto sizeBefore = commandQueue->commandStream->getUsed(); - auto pageFaultSizeBefore = pageFaultCmdQueue->commandStream->getUsed(); + auto sizeBefore = commandQueue->commandStream.getUsed(); + auto pageFaultSizeBefore = pageFaultCmdQueue->commandStream.getUsed(); auto handle = commandList->toHandle(); commandQueue->executeCommandLists(1, &handle, nullptr, true); - auto sizeAfter = commandQueue->commandStream->getUsed(); - auto pageFaultSizeAfter = pageFaultCmdQueue->commandStream->getUsed(); + auto sizeAfter = commandQueue->commandStream.getUsed(); + auto pageFaultSizeAfter = pageFaultCmdQueue->commandStream.getUsed(); EXPECT_LT(sizeBefore, sizeAfter); EXPECT_LT(pageFaultSizeBefore, pageFaultSizeAfter); GenCmdList commands; - CmdParse::parseCommandBuffer(commands, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), + CmdParse::parseCommandBuffer(commands, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), sizeAfter); auto count = findAll(commands.begin(), commands.end()).size(); EXPECT_EQ(0u, count); - CmdParse::parseCommandBuffer(commands, ptrOffset(pageFaultCmdQueue->commandStream->getCpuBase(), 0), + CmdParse::parseCommandBuffer(commands, ptrOffset(pageFaultCmdQueue->commandStream.getCpuBase(), 0), pageFaultSizeAfter); count = findAll(commands.begin(), commands.end()).size(); EXPECT_EQ(1u, count); diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_3.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_3.cpp index 722b4c52af..7eb6db5061 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_3.cpp @@ -83,7 +83,7 @@ HWTEST2_F(CommandQueueProgramSBATest, whenCreatingCommandQueueThenItIsInitialize commandQueue->initialize(false, false); uint32_t alignedSize = 4096u; - NEO::LinearStream child(commandQueue->commandStream->getSpace(alignedSize), alignedSize); + NEO::LinearStream child(commandQueue->commandStream.getSpace(alignedSize), alignedSize); auto &hwHelper = HwHelper::get(neoDevice->getHardwareInfo().platform.eRenderCoreFamily); const bool isaInLocalMemory = !hwHelper.useSystemMemoryPlacementForISA(neoDevice->getHardwareInfo()); @@ -129,15 +129,15 @@ HWTEST2_F(CommandQueueProgramSBATest, whenProgrammingStateBaseAddressWithStatele auto &commandStream = commandQueue->commandStream; auto alignedSize = commandQueue->estimateStateBaseAddressCmdSize(); - NEO::LinearStream child(commandStream->getSpace(alignedSize), alignedSize); + NEO::LinearStream child(commandStream.getSpace(alignedSize), alignedSize); auto cachedMOCSAllowed = false; commandQueue->programStateBaseAddress(0u, true, child, cachedMOCSAllowed); GenCmdList commands; ASSERT_TRUE(CmdParse::parseCommandBuffer( commands, - commandStream->getCpuBase(), - commandStream->getUsed())); + commandStream.getCpuBase(), + commandStream.getUsed())); auto itor = find(commands.begin(), commands.end()); ASSERT_NE(itor, commands.end()); @@ -169,13 +169,13 @@ HWTEST2_F(CommandQueueProgramSBATest, commandQueue->initialize(false, false); auto alignedSize = commandQueue->estimateStateBaseAddressCmdSize(); - NEO::LinearStream child(commandQueue->commandStream->getSpace(alignedSize), alignedSize); + NEO::LinearStream child(commandQueue->commandStream.getSpace(alignedSize), alignedSize); commandQueue->programStateBaseAddress(0u, true, child, true); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; - ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream->getCpuBase(), usedSpaceAfter)); + ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream.getCpuBase(), usedSpaceAfter)); auto itor = find(cmdList.begin(), cmdList.end()); ASSERT_NE(cmdList.end(), itor); @@ -210,14 +210,14 @@ HWTEST2_F(CommandQueueProgramSBATest, commandQueue->initialize(false, false); auto alignedSize = commandQueue->estimateStateBaseAddressCmdSize(); - NEO::LinearStream child(commandQueue->commandStream->getSpace(alignedSize), alignedSize); + NEO::LinearStream child(commandQueue->commandStream.getSpace(alignedSize), alignedSize); commandQueue->programStateBaseAddress(0u, true, child, true); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; - ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream->getCpuBase(), usedSpaceAfter)); + ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream.getCpuBase(), usedSpaceAfter)); auto itor = find(cmdList.begin(), cmdList.end()); ASSERT_NE(cmdList.end(), itor); @@ -763,7 +763,7 @@ HWTEST2_F(EngineInstancedDeviceExecuteTests, givenEngineInstancedDeviceWhenExecu commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false); GenCmdList cmdList; - FamilyType::PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream->getCpuBase(), commandQueue->commandStream->getUsed()); + FamilyType::PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream.getCpuBase(), commandQueue->commandStream.getUsed()); auto cfeStates = findAll(cmdList.begin(), cmdList.end()); diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist.cpp index 5498b0937d..b0914b5d77 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist.cpp @@ -110,7 +110,7 @@ HWTEST_F(CommandQueueExecuteCommandLists, whenACommandListExecutedRequiresUncach false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); auto commandList1 = whiteboxCast(CommandList::fromHandle(commandLists[0])); auto commandList2 = whiteboxCast(CommandList::fromHandle(commandLists[1])); @@ -136,7 +136,7 @@ HWTEST_F(CommandQueueExecuteCommandLists, givenCommandListThatRequiresDisabledEU false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); auto commandList1 = static_cast(CommandList::fromHandle(commandLists[0])); commandList1->requiredStreamState.frontEndState.disableEUFusion.set(true); @@ -164,19 +164,19 @@ HWTEST_F(CommandQueueExecuteCommandLists, whenASecondLevelBatchBufferPerCommandL false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, - ptrOffset(commandQueue->commandStream->getCpuBase(), 0), + ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto itorCurrent = cmdList.begin(); @@ -212,7 +212,7 @@ HWTEST_F(CommandQueueExecuteCommandLists, givenFenceWhenExecutingCmdListThenFenc false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); auto &csr = neoDevice->getUltCommandStreamReceiver(); *csr.tagAddress = 10; csr.taskCount = 10; @@ -251,7 +251,7 @@ HWTEST2_F(CommandQueueExecuteCommandLists, whenUsingFenceThenExpectEndingPipeCon false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); ze_fence_desc_t fenceDesc{}; auto fence = whiteboxCast(Fence::create(commandQueue, &fenceDesc)); @@ -259,18 +259,18 @@ HWTEST2_F(CommandQueueExecuteCommandLists, whenUsingFenceThenExpectEndingPipeCon ze_fence_handle_t fenceHandle = fence->toHandle(); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, fenceHandle, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, - ptrOffset(commandQueue->commandStream->getCpuBase(), 0), + ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto pipeControls = findAll(cmdList.begin(), cmdList.end()); @@ -303,19 +303,19 @@ HWTEST_F(CommandQueueExecuteCommandLists, whenExecutingCommandListsThenEndingPip false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, - ptrOffset(commandQueue->commandStream->getCpuBase(), 0), + ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); // Pipe control w/ Post-sync operation should be the last command @@ -350,19 +350,19 @@ HWTEST2_F(CommandQueueExecuteCommandLists, givenCommandQueueHaving2CommandListsT CommandList::fromHandle(commandLists[0])->setCommandListPerThreadScratchSize(512u); CommandList::fromHandle(commandLists[1])->setCommandListPerThreadScratchSize(1024u); - ASSERT_NE(nullptr, commandQueue->commandStream); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + ASSERT_NE(nullptr, commandQueue); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(1024u, neoDevice->getDefaultEngine().commandStreamReceiver->getScratchSpaceController()->getPerThreadScratchSpaceSize()); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, - ptrOffset(commandQueue->commandStream->getCpuBase(), 0), + ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto mediaVfeStates = findAll(cmdList.begin(), cmdList.end()); @@ -376,19 +376,19 @@ HWTEST2_F(CommandQueueExecuteCommandLists, givenCommandQueueHaving2CommandListsT CommandList::fromHandle(commandLists[0])->setCommandListPerThreadScratchSize(2048u); CommandList::fromHandle(commandLists[1])->setCommandListPerThreadScratchSize(1024u); - ASSERT_NE(nullptr, commandQueue->commandStream); - usedSpaceBefore = commandQueue->commandStream->getUsed(); + ASSERT_NE(nullptr, commandQueue); + usedSpaceBefore = commandQueue->commandStream.getUsed(); result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(2048u, neoDevice->getDefaultEngine().commandStreamReceiver->getScratchSpaceController()->getPerThreadScratchSpaceSize()); - usedSpaceAfter = commandQueue->commandStream->getUsed(); + usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList1; ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList1, - ptrOffset(commandQueue->commandStream->getCpuBase(), 0), + ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); mediaVfeStates = findAll(cmdList1.begin(), cmdList1.end()); @@ -425,18 +425,18 @@ HWTEST_F(CommandQueueExecuteCommandLists, givenMidThreadPreemptionWhenCommandsAr returnValue)); EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; - ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto itorSip = find(cmdList.begin(), cmdList.end()); @@ -479,9 +479,9 @@ HWTEST2_F(CommandQueueExecuteCommandLists, givenMidThreadPreemptionWhenCommandsA returnValue)); EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); @@ -489,11 +489,11 @@ HWTEST2_F(CommandQueueExecuteCommandLists, givenMidThreadPreemptionWhenCommandsA result = commandQueue->synchronize(0); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter1stExecute = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter1stExecute = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter1stExecute, usedSpaceBefore); GenCmdList cmdList; - ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream->getCpuBase(), usedSpaceAfter1stExecute)); + ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream.getCpuBase(), usedSpaceAfter1stExecute)); auto itorSip = find(cmdList.begin(), cmdList.end()); @@ -515,8 +515,8 @@ HWTEST2_F(CommandQueueExecuteCommandLists, givenMidThreadPreemptionWhenCommandsA ASSERT_EQ(ZE_RESULT_SUCCESS, result); GenCmdList cmdList2; - auto cmdBufferAddress = ptrOffset(commandQueue->commandStream->getCpuBase(), usedSpaceAfter1stExecute); - auto usedSpaceOn2ndExecute = commandQueue->commandStream->getUsed() - usedSpaceAfter1stExecute; + auto cmdBufferAddress = ptrOffset(commandQueue->commandStream.getCpuBase(), usedSpaceAfter1stExecute); + auto usedSpaceOn2ndExecute = commandQueue->commandStream.getUsed() - usedSpaceAfter1stExecute; ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList2, cmdBufferAddress, usedSpaceOn2ndExecute)); @@ -661,10 +661,10 @@ void CommandQueueExecuteCommandLists::twoCommandListCommandPreemptionTest(bool p auto commandQueue = whiteboxCast(CommandQueue::create( productFamily, device, currentCsr, &desc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); commandQueue->preemptionCmdSyncProgramming = preemptionCmdProgramming; preemptionCmdProgramming = NEO::PreemptionHelper::getRequiredCmdStreamSize(NEO::PreemptionMode::ThreadGroup, NEO::PreemptionMode::Disabled) > 0u; - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto commandListDisabled = whiteboxCast(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)); commandListDisabled->commandListPreemptionMode = NEO::PreemptionMode::Disabled; @@ -689,12 +689,12 @@ void CommandQueueExecuteCommandLists::twoCommandListCommandPreemptionTest(bool p EXPECT_EQ(NEO::PreemptionMode::Disabled, currentCsr->getPreemptionMode()); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, commandQueue->commandStream->getCpuBase(), usedSpaceAfter)); + cmdList, commandQueue->commandStream.getCpuBase(), usedSpaceAfter)); using STATE_SIP = typename FamilyType::STATE_SIP; using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; @@ -957,12 +957,12 @@ HWTEST_F(CommandQueueExecuteCommandLists, GivenCopyCommandQueueWhenExecutingCopy zet_command_list_handle_t cmdListHandle = commandList->toHandle(); returnValue = commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, false); ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue); - size_t usedSpaceAfter = commandQueue->commandStream->getUsed(); + size_t usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( cmdList, - commandQueue->commandStream->getCpuBase(), + commandQueue->commandStream.getCpuBase(), usedSpaceAfter)); size_t preemptionMmioCount = countMmio(cmdList.begin(), cmdList.end(), preemptionRegisterOffset); @@ -999,7 +999,7 @@ struct CommandQueueExecuteCommandListSWTagsTests : public Test { false, returnValue)); EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); } void TearDown() override { @@ -1023,16 +1023,16 @@ HWTEST_F(CommandQueueExecuteCommandListSWTagsTests, givenEnableSWTagsWhenExecuti using MI_STORE_DATA_IMM = typename FamilyType::MI_STORE_DATA_IMM; using PARSE = typename FamilyType::PARSE; - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(1, commandLists, nullptr, false); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; - ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto sdis = findAll(cmdList.begin(), cmdList.end()); ASSERT_LE(2u, sdis.size()); @@ -1049,16 +1049,16 @@ HWTEST_F(CommandQueueExecuteCommandListSWTagsTests, givenEnableSWTagsAndCommandL using PARSE = typename FamilyType::PARSE; whiteboxCast(CommandList::fromHandle(commandLists[0]))->commandListPreemptionMode = PreemptionMode::Disabled; - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(1, commandLists, nullptr, false); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; - ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto noops = findAll(cmdList.begin(), cmdList.end()); ASSERT_LE(2u, noops.size()); @@ -1139,7 +1139,7 @@ HWTEST2_F(MultiDeviceCommandQueueExecuteCommandLists, givenMultiplePartitionCoun returnValue)); EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue); EXPECT_EQ(2u, commandQueue->partitionCount); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); auto &commandStreamReceiver = device->getNEODevice()->getDefaultEngine().commandStreamReceiver; if (neoDevice->getPreemptionMode() == PreemptionMode::MidThread || neoDevice->isDebuggerActive()) { @@ -1152,20 +1152,20 @@ HWTEST2_F(MultiDeviceCommandQueueExecuteCommandLists, givenMultiplePartitionCoun ze_fence_handle_t fenceHandle = fence->toHandle(); // 1st execute call initialized pipeline - auto usedSpaceBefore1stExecute = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore1stExecute = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, fenceHandle, true); EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue); - auto usedSpaceOn1stExecute = commandQueue->commandStream->getUsed() - usedSpaceBefore1stExecute; + auto usedSpaceOn1stExecute = commandQueue->commandStream.getUsed() - usedSpaceBefore1stExecute; // 1st call then initialize registers GenCmdList cmdList; - ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), usedSpaceBefore1stExecute), usedSpaceOn1stExecute)); + ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), usedSpaceBefore1stExecute), usedSpaceOn1stExecute)); findPartitionRegister(cmdList, true); - auto usedSpaceBefore2ndExecute = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore2ndExecute = commandQueue->commandStream.getUsed(); result = commandQueue->executeCommandLists(numCommandLists, commandLists, fenceHandle, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter2ndExecute = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter2ndExecute = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter2ndExecute, usedSpaceBefore2ndExecute); size_t cmdBufferSizeWithoutMmioProgramming = usedSpaceAfter2ndExecute - usedSpaceBefore2ndExecute; @@ -1175,20 +1175,20 @@ HWTEST2_F(MultiDeviceCommandQueueExecuteCommandLists, givenMultiplePartitionCoun } cmdList.clear(); - ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), usedSpaceBefore2ndExecute), cmdBufferSizeWithoutMmioProgramming)); + ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), usedSpaceBefore2ndExecute), cmdBufferSizeWithoutMmioProgramming)); findPartitionRegister(cmdList, false); - auto usedSpaceBefore3rdExecute = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore3rdExecute = commandQueue->commandStream.getUsed(); result = commandQueue->executeCommandLists(numCommandLists, commandLists, fenceHandle, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter3rdExecute = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter3rdExecute = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter3rdExecute, usedSpaceBefore3rdExecute); size_t cmdBufferSizeWithMmioProgramming = usedSpaceAfter3rdExecute - usedSpaceBefore3rdExecute; EXPECT_GE(cmdBufferSizeWithMmioProgramming, cmdBufferSizeWithoutMmioProgramming); cmdList.clear(); - ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), usedSpaceBefore3rdExecute), cmdBufferSizeWithMmioProgramming)); + ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), usedSpaceBefore3rdExecute), cmdBufferSizeWithMmioProgramming)); findPartitionRegister(cmdList, false); auto pipeControlList = findAll(cmdList.begin(), cmdList.end()); @@ -1241,10 +1241,10 @@ HWTEST_F(CommandQueueExecuteCommandLists, GivenUpdateTaskCountFromWaitWhenExecut zet_command_list_handle_t cmdListHandle = commandList->toHandle(); returnValue = commandQueue->executeCommandLists(1, &cmdListHandle, fenceHandle, false); ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue); - size_t usedSpaceAfter = commandQueue->commandStream->getUsed(); + size_t usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; - ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream->getCpuBase(), usedSpaceAfter)); + ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream.getCpuBase(), usedSpaceAfter)); uint32_t foundPostSyncMiFlush = 0u; auto miFlushList = findAll(cmdList.begin(), cmdList.end()); @@ -1293,10 +1293,10 @@ HWTEST_F(CommandQueueExecuteCommandLists, GivenCopyCommandQueueWhenExecutingCopy zet_command_list_handle_t cmdListHandle = commandList->toHandle(); returnValue = commandQueue->executeCommandLists(1, &cmdListHandle, fenceHandle, false); ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue); - size_t usedSpaceAfter = commandQueue->commandStream->getUsed(); + size_t usedSpaceAfter = commandQueue->commandStream.getUsed(); GenCmdList cmdList; - ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream->getCpuBase(), usedSpaceAfter)); + ASSERT_TRUE(PARSE::parseCommandBuffer(cmdList, commandQueue->commandStream.getCpuBase(), usedSpaceAfter)); uint32_t foundPostSyncMiFlush = 0u; auto miFlushList = findAll(cmdList.begin(), cmdList.end()); diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist_2.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist_2.cpp index b2f138d197..61e24a69f1 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist_2.cpp @@ -79,14 +79,14 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, whenUsingFenceThenLastPipeC ze_result_t returnValue; queueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); ze_fence_desc_t fenceDesc = {}; auto fence = whiteboxCast(Fence::create(commandQueue, &fenceDesc)); ze_fence_handle_t fenceHandle = fence->toHandle(); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle(), @@ -96,12 +96,12 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, whenUsingFenceThenLastPipeC ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto pipeControls = findAll(cmdList.begin(), cmdList.end()); size_t pipeControlsPostSyncNumber = 0u; @@ -139,18 +139,18 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, givenTwoCommandQueuesUsingS queueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); returnValue = commandQueue->executeCommandLists(1, &commandList, nullptr, false); ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( cmdList, - ptrOffset(commandQueue->commandStream->getCpuBase(), usedSpaceBefore), + ptrOffset(commandQueue->commandStream.getCpuBase(), usedSpaceBefore), usedSpaceAfter - usedSpaceBefore)); auto pipelineSelect = findAll(cmdList.begin(), cmdList.end()); @@ -164,17 +164,17 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, givenTwoCommandQueuesUsingS auto commandQueue2 = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue); - ASSERT_NE(nullptr, commandQueue2->commandStream); + ASSERT_NE(nullptr, commandQueue2); - usedSpaceBefore = commandQueue2->commandStream->getUsed(); + usedSpaceBefore = commandQueue2->commandStream.getUsed(); returnValue = commandQueue2->executeCommandLists(1, &commandList, nullptr, false); ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue); - usedSpaceAfter = commandQueue2->commandStream->getUsed(); + usedSpaceAfter = commandQueue2->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( cmdList, - ptrOffset(commandQueue2->commandStream->getCpuBase(), usedSpaceBefore), + ptrOffset(commandQueue2->commandStream.getCpuBase(), usedSpaceBefore), usedSpaceAfter - usedSpaceBefore)); pipelineSelect = findAll(cmdList.begin(), cmdList.end()); @@ -201,18 +201,18 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, givenTwoCommandQueuesUsingS queueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); returnValue = commandQueue->executeCommandLists(1, &commandList, nullptr, false); ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( cmdList, - ptrOffset(commandQueue->commandStream->getCpuBase(), usedSpaceBefore), + ptrOffset(commandQueue->commandStream.getCpuBase(), usedSpaceBefore), usedSpaceAfter - usedSpaceBefore)); auto loadRegisterImmList = findAll(cmdList.begin(), cmdList.end()); @@ -232,17 +232,17 @@ HWTEST2_F(CommandQueueExecuteCommandListsSimpleTest, givenTwoCommandQueuesUsingS auto commandQueue2 = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue); - ASSERT_NE(nullptr, commandQueue2->commandStream); + ASSERT_NE(nullptr, commandQueue2); - usedSpaceBefore = commandQueue2->commandStream->getUsed(); + usedSpaceBefore = commandQueue2->commandStream.getUsed(); returnValue = commandQueue2->executeCommandLists(1, &commandList, nullptr, false); ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue); - usedSpaceAfter = commandQueue2->commandStream->getUsed(); + usedSpaceAfter = commandQueue2->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( cmdList, - ptrOffset(commandQueue2->commandStream->getCpuBase(), usedSpaceBefore), + ptrOffset(commandQueue2->commandStream.getCpuBase(), usedSpaceBefore), usedSpaceAfter - usedSpaceBefore)); loadRegisterImmList = findAll(cmdList.begin(), cmdList.end()); @@ -272,7 +272,7 @@ struct PauseOnGpuTests : public Test { ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); commandList = CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue); commandListHandle = commandList->toHandle(); diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp index 33f0685d58..117e67b8a0 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp @@ -84,9 +84,9 @@ HWTEST_F(L0DebuggerPerContextAddressSpaceTest, givenDebuggingEnabledWhenCommandL ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -95,12 +95,12 @@ HWTEST_F(L0DebuggerPerContextAddressSpaceTest, givenDebuggingEnabledWhenCommandL auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); @@ -423,7 +423,7 @@ HWTEST_F(L0DebuggerSimpleTest, givenUseCsrImmediateSubmissionEnabledForRegularCo ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -457,7 +457,7 @@ HWTEST_F(L0DebuggerSimpleTest, givenUseCsrImmediateSubmissionDisabledForRegularC ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp index 9bc59ded99..4e5d108230 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp @@ -309,7 +309,7 @@ HWTEST2_P(L0DebuggerWithBlitterTest, givenUseCsrImmediateSubmissionEnabledForReg ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -442,9 +442,9 @@ HWTEST_P(L0DebuggerWithBlitterTest, givenDebuggingEnabledWhenCommandListIsExecut ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, bcsEngine->commandStreamReceiver, &queueDesc, true, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto commandList = CommandList::create(productFamily, device, EngineGroupType::Copy, 0u, returnValue); ze_command_list_handle_t commandLists[] = {commandList->toHandle()}; @@ -458,12 +458,12 @@ HWTEST_P(L0DebuggerWithBlitterTest, givenDebuggingEnabledWhenCommandListIsExecut result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp index 7bd5923652..4e3e8883c4 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp @@ -133,7 +133,7 @@ HWTEST2_F(L0DebuggerPerContextAddressSpaceTest, givenDebuggingEnabledAndRequired GTEST_SKIP(); } - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -144,12 +144,12 @@ HWTEST2_F(L0DebuggerPerContextAddressSpaceTest, givenDebuggingEnabledAndRequired auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto sbaItor = find(cmdList.begin(), cmdList.end()); ASSERT_NE(cmdList.end(), sbaItor); @@ -184,7 +184,7 @@ HWTEST2_F(L0DebuggerTest, givenDebuggingEnabledAndDebuggerLogsWhenCommandQueueIs ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -220,7 +220,7 @@ HWTEST2_F(L0DebuggerSimpleTest, givenNullL0DebuggerAndDebuggerLogsWhenCommandQue ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -251,7 +251,7 @@ HWTEST2_F(L0DebuggerTest, givenL0DebuggerAndDebuggerLogsDisabledWhenCommandQueue ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -337,9 +337,9 @@ HWTEST2_F(L0DebuggerTest, givenDebugerEnabledWhenPrepareAndSubmitBatchBufferThen auto &commandStream = commandQueue->commandStream; auto estimatedSize = 4096u; - NEO::LinearStream linearStream(commandStream->getSpace(estimatedSize), estimatedSize); + NEO::LinearStream linearStream(commandStream.getSpace(estimatedSize), estimatedSize); // fill with random data - memset(commandStream->getCpuBase(), 0xD, estimatedSize); + memset(commandStream.getCpuBase(), 0xD, estimatedSize); typename MockCommandQueueHw::CommandListExecutionContext ctx{}; ctx.isDebugEnabled = true; @@ -350,7 +350,7 @@ HWTEST2_F(L0DebuggerTest, givenDebugerEnabledWhenPrepareAndSubmitBatchBufferThen auto offsetInBytes = sizeof(typename FamilyType::MI_BATCH_BUFFER_END); auto isLeftoverZeroed = true; for (auto i = offsetInBytes; i < estimatedSize; i++) { - uint8_t *data = reinterpret_cast(commandStream->getCpuBase()); + uint8_t *data = reinterpret_cast(commandStream.getCpuBase()); if (data[i] != 0) { isLeftoverZeroed = false; break; @@ -381,9 +381,9 @@ HWTEST2_F(L0DebuggerSingleAddressSpace, givenDebuggingEnabledWhenCommandListIsEx ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -392,12 +392,12 @@ HWTEST2_F(L0DebuggerSingleAddressSpace, givenDebuggingEnabledWhenCommandListIsEx auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp index 45bc8a410b..72c468fc2e 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp @@ -32,9 +32,9 @@ HWTEST2_F(CommandQueueDebugCommandsTest, givenDebuggingEnabledWhenCommandListIsE ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, deviceL0, device->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, deviceL0, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -43,12 +43,12 @@ HWTEST2_F(CommandQueueDebugCommandsTest, givenDebuggingEnabledWhenCommandListIsE auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); @@ -81,9 +81,9 @@ HWTEST2_F(CommandQueueDebugCommandsTest, givenDebuggingEnabledWhenCommandListIsE ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, deviceL0, device->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, deviceL0, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -92,7 +92,7 @@ HWTEST2_F(CommandQueueDebugCommandsTest, givenDebuggingEnabledWhenCommandListIsE auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); size_t debugModeRegisterCount = 0; @@ -101,7 +101,7 @@ HWTEST2_F(CommandQueueDebugCommandsTest, givenDebuggingEnabledWhenCommandListIsE { GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); @@ -124,13 +124,13 @@ HWTEST2_F(CommandQueueDebugCommandsTest, givenDebuggingEnabledWhenCommandListIsE result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter2 = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter2 = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter2, usedSpaceAfter); { GenCmdList cmdList2; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList2, ptrOffset(commandQueue->commandStream->getCpuBase(), usedSpaceAfter), usedSpaceAfter2 - usedSpaceAfter)); + cmdList2, ptrOffset(commandQueue->commandStream.getCpuBase(), usedSpaceAfter), usedSpaceAfter2 - usedSpaceAfter)); auto miLoadImm2 = findAll(cmdList2.begin(), cmdList2.end()); @@ -175,12 +175,12 @@ HWTEST2_F(SLDebuggerInternalUsageTest, givenDebuggingEnabledWhenInternalCmdQIsUs CommandList::createImmediate(productFamily, deviceL0, &queueDesc, true, NEO::EngineGroupType::RenderCompute, returnValue)->toHandle()}; uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true); EXPECT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); size_t debugModeRegisterCount = 0; @@ -189,7 +189,7 @@ HWTEST2_F(SLDebuggerInternalUsageTest, givenDebuggingEnabledWhenInternalCmdQIsUs { GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); auto miLoadImm = findAll(cmdList.begin(), cmdList.end()); diff --git a/level_zero/core/test/unit_tests/xe_hp_core/test_cmdqueue_debugger_xe_hp_core.cpp b/level_zero/core/test/unit_tests/xe_hp_core/test_cmdqueue_debugger_xe_hp_core.cpp index bb5aa72bac..a52991b6ce 100644 --- a/level_zero/core/test/unit_tests/xe_hp_core/test_cmdqueue_debugger_xe_hp_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hp_core/test_cmdqueue_debugger_xe_hp_core.cpp @@ -40,7 +40,7 @@ XEHPTEST_F(CommandQueueDebugCommandsForSldXeHP, givenSteppingA0OrBWhenGlobalSipI hwInfo.platform.usRevId = revision; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, deviceL0, device->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, deviceL0, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -51,14 +51,14 @@ XEHPTEST_F(CommandQueueDebugCommandsForSldXeHP, givenSteppingA0OrBWhenGlobalSipI std::vector globalSip; for (uint32_t execCount = 0; execCount < 2; execCount++) { - auto startPointer = ptrOffset(commandQueue->commandStream->getCpuBase(), commandQueue->commandStream->getUsed()); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto startPointer = ptrOffset(commandQueue->commandStream.getCpuBase(), commandQueue->commandStream.getUsed()); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(1, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); commandQueue->synchronize(0); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); EXPECT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; @@ -119,7 +119,7 @@ XEHPTEST_F(CommandQueueDebugCommandsDebuggerL0XeHP, givenSteppingA0OrBWhenGlobal hwInfo.platform.usRevId = revision; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); + ASSERT_NE(nullptr, commandQueue); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -128,14 +128,14 @@ XEHPTEST_F(CommandQueueDebugCommandsDebuggerL0XeHP, givenSteppingA0OrBWhenGlobal std::vector globalSip; for (uint32_t execCount = 0; execCount < 2; execCount++) { - auto startPointer = ptrOffset(commandQueue->commandStream->getCpuBase(), commandQueue->commandStream->getUsed()); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + auto startPointer = ptrOffset(commandQueue->commandStream.getCpuBase(), commandQueue->commandStream.getUsed()); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); auto result = commandQueue->executeCommandLists(1, commandLists, nullptr, true); ASSERT_EQ(ZE_RESULT_SUCCESS, result); commandQueue->synchronize(0); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); EXPECT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; diff --git a/level_zero/core/test/unit_tests/xe_hp_core/test_cmdqueue_enqueuecommandlist_xe_hp_core.cpp b/level_zero/core/test/unit_tests/xe_hp_core/test_cmdqueue_enqueuecommandlist_xe_hp_core.cpp index aabfa73772..8049bb9300 100644 --- a/level_zero/core/test/unit_tests/xe_hp_core/test_cmdqueue_enqueuecommandlist_xe_hp_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hp_core/test_cmdqueue_enqueuecommandlist_xe_hp_core.cpp @@ -30,8 +30,8 @@ XE_HP_CORE_TEST_F(CommandQueueExecuteCommandListsXE_HP_CORE, WhenExecutingCmdLis auto commandQueue = whiteboxCast(CommandQueue::create( productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &desc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + ASSERT_NE(nullptr, commandQueue); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -40,12 +40,12 @@ XE_HP_CORE_TEST_F(CommandQueueExecuteCommandListsXE_HP_CORE, WhenExecutingCmdLis ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using CFE_STATE = typename FamilyType::CFE_STATE; auto itorCFE = find(cmdList.begin(), cmdList.end()); @@ -71,8 +71,8 @@ XE_HP_CORE_TEST_F(CommandQueueExecuteCommandListsXE_HP_CORE, WhenExecutingCmdLis auto commandQueue = whiteboxCast(CommandQueue::create( productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &desc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + ASSERT_NE(nullptr, commandQueue); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -81,12 +81,12 @@ XE_HP_CORE_TEST_F(CommandQueueExecuteCommandListsXE_HP_CORE, WhenExecutingCmdLis ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; auto itorSba = find(cmdList.begin(), cmdList.end()); diff --git a/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdqueue_xe_hpc_core.cpp b/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdqueue_xe_hpc_core.cpp index d4bf998dc2..e7689cda1e 100644 --- a/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdqueue_xe_hpc_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdqueue_xe_hpc_core.cpp @@ -68,10 +68,10 @@ HWTEST2_F(CommandQueueCommandsXeHpc, givenCommandQueueWhenExecutingCommandListsT auto globalFence = csr->getGlobalFenceAllocation(); - auto used = commandQueue->commandStream->getUsed(); + auto used = commandQueue->commandStream.getUsed(); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, commandQueue->commandStream->getCpuBase(), used)); + cmdList, commandQueue->commandStream.getCpuBase(), used)); auto itor = find(cmdList.begin(), cmdList.end()); ASSERT_NE(cmdList.end(), itor); @@ -94,12 +94,12 @@ HWTEST2_F(CommandQueueCommandsXeHpc, givenCommandQueueWhenExecutingCommandListsF std::unique_ptr commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Compute, 0u, returnValue)); auto commandListHandle = commandList->toHandle(); commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false); - auto usedSpaceAfter1stExecute = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter1stExecute = commandQueue->commandStream.getUsed(); commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false); - auto usedSpaceOn2ndExecute = commandQueue->commandStream->getUsed() - usedSpaceAfter1stExecute; + auto usedSpaceOn2ndExecute = commandQueue->commandStream.getUsed() - usedSpaceAfter1stExecute; GenCmdList cmdList; - auto cmdBufferAddress = ptrOffset(commandQueue->commandStream->getCpuBase(), usedSpaceAfter1stExecute); + auto cmdBufferAddress = ptrOffset(commandQueue->commandStream.getCpuBase(), usedSpaceAfter1stExecute); ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(cmdList, cmdBufferAddress, usedSpaceOn2ndExecute)); auto itor = find(cmdList.begin(), cmdList.end()); diff --git a/level_zero/core/test/unit_tests/xe_hpg_core/test_cmdqueue_enqueuecommandlist_xe_hpg_core.cpp b/level_zero/core/test/unit_tests/xe_hpg_core/test_cmdqueue_enqueuecommandlist_xe_hpg_core.cpp index 39d63f2142..11ca90d942 100644 --- a/level_zero/core/test/unit_tests/xe_hpg_core/test_cmdqueue_enqueuecommandlist_xe_hpg_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpg_core/test_cmdqueue_enqueuecommandlist_xe_hpg_core.cpp @@ -32,8 +32,8 @@ XE_HPG_CORETEST_F(CommandQueueExecuteCommandListsXeHpgCore, WhenExecutingCmdList auto commandQueue = whiteboxCast(CommandQueue::create( productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &desc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + ASSERT_NE(nullptr, commandQueue); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -42,12 +42,12 @@ XE_HPG_CORETEST_F(CommandQueueExecuteCommandListsXeHpgCore, WhenExecutingCmdList ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using CFE_STATE = typename FamilyType::CFE_STATE; auto itorCFE = find(cmdList.begin(), cmdList.end()); @@ -73,8 +73,8 @@ XE_HPG_CORETEST_F(CommandQueueExecuteCommandListsXeHpgCore, WhenExecutingCmdList auto commandQueue = whiteboxCast(CommandQueue::create( productFamily, device, neoDevice->getDefaultEngine().commandStreamReceiver, &desc, false, false, returnValue)); - ASSERT_NE(nullptr, commandQueue->commandStream); - auto usedSpaceBefore = commandQueue->commandStream->getUsed(); + ASSERT_NE(nullptr, commandQueue); + auto usedSpaceBefore = commandQueue->commandStream.getUsed(); ze_command_list_handle_t commandLists[] = { CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()}; @@ -83,12 +83,12 @@ XE_HPG_CORETEST_F(CommandQueueExecuteCommandListsXeHpgCore, WhenExecutingCmdList ASSERT_EQ(ZE_RESULT_SUCCESS, result); - auto usedSpaceAfter = commandQueue->commandStream->getUsed(); + auto usedSpaceAfter = commandQueue->commandStream.getUsed(); ASSERT_GT(usedSpaceAfter, usedSpaceBefore); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(commandQueue->commandStream->getCpuBase(), 0), usedSpaceAfter)); + cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter)); using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; auto itorSba = find(cmdList.begin(), cmdList.end());