From 308f9ccfff2e9bf22bc7c5ac452c890595bdf9b0 Mon Sep 17 00:00:00 2001 From: Dominik Dabek Date: Mon, 28 Mar 2022 12:55:12 +0000 Subject: [PATCH] Do not allocate dynamic state heap if not needed Dynamic state heap is only used for sampler data. Related-To: NEO-6821 Signed-off-by: Dominik Dabek --- .../source/cmdlist/cmdlist_hw_immediate.inl | 6 +- .../sources/cmdlist/test_cmdlist_1.cpp | 11 +- .../test_cmdlist_append_launch_kernel_1.cpp | 24 +- .../cmdlist/test_cmdlist_xehp_and_later.cpp | 36 ++- opencl/source/command_queue/enqueue_common.h | 12 +- opencl/source/helpers/task_information.cpp | 18 +- .../aub_multicontext_tests_xehp_and_later.cpp | 6 +- .../command_stream/aub_mi_atomic_tests.cpp | 6 +- ...range_based_flush_tests_xehp_and_later.cpp | 12 +- ..._walker_partition_tests_xehp_and_later.cpp | 6 +- .../mi_math_aub_tests_dg2_and_later.cpp | 6 +- .../command_queue/enqueue_handler_tests.cpp | 5 +- .../command_queue/enqueue_kernel_1_tests.cpp | 1 + .../enqueue_read_image_tests.cpp | 2 +- ...and_stream_receiver_flush_task_1_tests.cpp | 89 ++--- ...and_stream_receiver_flush_task_2_tests.cpp | 30 +- ...and_stream_receiver_flush_task_3_tests.cpp | 305 +++++++++--------- ...and_stream_receiver_flush_task_4_tests.cpp | 6 +- ...stream_receiver_flush_task_gmock_tests.cpp | 69 ++-- ...ceiver_flush_task_tests_xehp_and_later.cpp | 39 +-- .../command_stream_receiver_hw_1_tests.cpp | 6 +- ...stream_receiver_hw_tests_dg2_and_later.cpp | 12 +- .../ult_command_stream_receiver_fixture.h | 6 +- .../unit_test/gen11/coherency_tests_gen11.cpp | 2 +- .../gen12lp/coherency_tests_gen12lp.inl | 8 +- .../helpers/task_information_tests.cpp | 4 +- .../helpers/timestamp_packet_2_tests.cpp | 8 +- opencl/test/unit_test/kernel/kernel_tests.cpp | 6 +- .../linux/drm_command_stream_tests_1.cpp | 4 +- ...te_command_queue_with_properties_tests.cpp | 20 +- .../windows/device_command_stream_tests.cpp | 5 +- .../source_level_debugger_csr_tests.cpp | 26 +- .../source_level_debugger_csr_tests_xehp.cpp | 14 +- .../source/command_container/cmdcontainer.cpp | 3 + .../command_encoder_xehp_and_later.inl | 43 +-- .../command_stream/command_stream_receiver.h | 2 +- .../command_stream_receiver_hw.h | 8 +- .../command_stream_receiver_hw_base.inl | 56 ++-- .../libult/ult_command_stream_receiver.h | 2 +- shared/test/common/mocks/mock_aub_csr.h | 2 +- .../mocks/mock_command_stream_receiver.cpp | 6 +- .../mocks/mock_command_stream_receiver.h | 10 +- shared/test/common/mocks/mock_csr.h | 6 +- .../command_container_tests.cpp | 172 ++++++---- .../compute_mode_tests_xehp_and_later.cpp | 8 +- .../encoders/test_encode_dispatch_kernel.cpp | 6 +- .../unit_test/encoders/test_encode_states.cpp | 21 +- .../unit_test/preemption/preemption_tests.cpp | 12 +- .../compute_mode_tests_xe_hpc_core.cpp | 2 +- 49 files changed, 639 insertions(+), 530 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl index 9c8885fb41..31f0e0015a 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl @@ -105,9 +105,9 @@ ze_result_t CommandListCoreFamilyImmediate::executeCommandListImm auto completionStamp = this->csr->flushTask( *commandStream, commandStreamStart, - *(this->commandContainer.getIndirectHeap(NEO::IndirectHeap::Type::DYNAMIC_STATE)), - *(this->commandContainer.getIndirectHeap(NEO::IndirectHeap::Type::INDIRECT_OBJECT)), - *(this->commandContainer.getIndirectHeap(NEO::IndirectHeap::Type::SURFACE_STATE)), + this->commandContainer.getIndirectHeap(NEO::IndirectHeap::Type::DYNAMIC_STATE), + this->commandContainer.getIndirectHeap(NEO::IndirectHeap::Type::INDIRECT_OBJECT), + this->commandContainer.getIndirectHeap(NEO::IndirectHeap::Type::SURFACE_STATE), this->csr->peekTaskLevel(), dispatchFlags, *(this->device->getNEODevice())); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp index e76d2a48f2..9a2fd44745 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp @@ -84,9 +84,14 @@ TEST_F(CommandListCreate, whenCommandListIsCreatedThenItIsInitialized) { ASSERT_NE(nullptr, commandList->commandContainer.getCommandStream()); for (uint32_t i = 0; i < NEO::HeapType::NUM_TYPES; i++) { - ASSERT_NE(commandList->commandContainer.getIndirectHeap(static_cast(i)), nullptr); - ++numAllocations; - ASSERT_NE(commandList->commandContainer.getIndirectHeapAllocation(static_cast(i)), nullptr); + auto heapType = static_cast(i); + if (NEO::HeapType::DYNAMIC_STATE == heapType && !device->getHwInfo().capabilityTable.supportsImages) { + ASSERT_EQ(commandList->commandContainer.getIndirectHeap(heapType), nullptr); + } else { + ASSERT_NE(commandList->commandContainer.getIndirectHeap(heapType), nullptr); + ++numAllocations; + ASSERT_NE(commandList->commandContainer.getIndirectHeapAllocation(heapType), nullptr); + } } EXPECT_LT(0u, commandList->commandContainer.getCommandStream()->getAvailableSpace()); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp index bb96daf4f2..097d42e719 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp @@ -986,18 +986,22 @@ HWTEST_F(CommandListAppendLaunchKernel, givenCommandListWhenResetCalledThenState for (uint32_t i = 0; i < NEO::HeapType::NUM_TYPES; i++) { auto heapType = static_cast(i); + if (NEO::HeapType::DYNAMIC_STATE == heapType && !device->getHwInfo().capabilityTable.supportsImages) { + ASSERT_EQ(nullptr, commandListControl->commandContainer.getIndirectHeapAllocation(heapType)); + ASSERT_EQ(nullptr, commandListControl->commandContainer.getIndirectHeap(heapType)); + } else { + ASSERT_NE(nullptr, commandListControl->commandContainer.getIndirectHeapAllocation(heapType)); + ASSERT_NE(nullptr, commandList->commandContainer.getIndirectHeapAllocation(heapType)); + ASSERT_EQ(commandListControl->commandContainer.getIndirectHeapAllocation(heapType)->getUnderlyingBufferSize(), + commandList->commandContainer.getIndirectHeapAllocation(heapType)->getUnderlyingBufferSize()); - ASSERT_NE(nullptr, commandListControl->commandContainer.getIndirectHeapAllocation(heapType)); - ASSERT_NE(nullptr, commandList->commandContainer.getIndirectHeapAllocation(heapType)); - ASSERT_EQ(commandListControl->commandContainer.getIndirectHeapAllocation(heapType)->getUnderlyingBufferSize(), - commandList->commandContainer.getIndirectHeapAllocation(heapType)->getUnderlyingBufferSize()); + ASSERT_NE(nullptr, commandListControl->commandContainer.getIndirectHeap(heapType)); + ASSERT_NE(nullptr, commandList->commandContainer.getIndirectHeap(heapType)); + ASSERT_EQ(commandListControl->commandContainer.getIndirectHeap(heapType)->getUsed(), + commandList->commandContainer.getIndirectHeap(heapType)->getUsed()); - ASSERT_NE(nullptr, commandListControl->commandContainer.getIndirectHeap(heapType)); - ASSERT_NE(nullptr, commandList->commandContainer.getIndirectHeap(heapType)); - ASSERT_EQ(commandListControl->commandContainer.getIndirectHeap(heapType)->getUsed(), - commandList->commandContainer.getIndirectHeap(heapType)->getUsed()); - - ASSERT_EQ(commandListControl->commandContainer.isHeapDirty(heapType), commandList->commandContainer.isHeapDirty(heapType)); + ASSERT_EQ(commandListControl->commandContainer.isHeapDirty(heapType), commandList->commandContainer.isHeapDirty(heapType)); + } } GenCmdList cmdList; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp index 48cc1d2b32..20426be0d2 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp @@ -59,14 +59,18 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandListTests, whenCommandListIsCreatedThenPCAnd auto cmdSba = genCmdCast(*itor); - auto dsh = commandContainer.getIndirectHeap(NEO::HeapType::DYNAMIC_STATE); + if constexpr (FamilyType::supportsSampler) { + auto dsh = commandContainer.getIndirectHeap(NEO::HeapType::DYNAMIC_STATE); + EXPECT_TRUE(cmdSba->getDynamicStateBaseAddressModifyEnable()); + EXPECT_TRUE(cmdSba->getDynamicStateBufferSizeModifyEnable()); + EXPECT_EQ(dsh->getHeapGpuBase(), cmdSba->getDynamicStateBaseAddress()); + EXPECT_EQ(dsh->getHeapSizeInPages(), cmdSba->getDynamicStateBufferSize()); + } else { + EXPECT_FALSE(cmdSba->getDynamicStateBaseAddressModifyEnable()); + EXPECT_FALSE(cmdSba->getDynamicStateBufferSizeModifyEnable()); + } + auto ssh = commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE); - - EXPECT_TRUE(cmdSba->getDynamicStateBaseAddressModifyEnable()); - EXPECT_TRUE(cmdSba->getDynamicStateBufferSizeModifyEnable()); - EXPECT_EQ(dsh->getHeapGpuBase(), cmdSba->getDynamicStateBaseAddress()); - EXPECT_EQ(dsh->getHeapSizeInPages(), cmdSba->getDynamicStateBufferSize()); - EXPECT_TRUE(cmdSba->getSurfaceStateBaseAddressModifyEnable()); EXPECT_EQ(ssh->getHeapGpuBase(), cmdSba->getSurfaceStateBaseAddress()); @@ -124,15 +128,17 @@ HWTEST2_F(CommandListTests, whenCommandListIsCreatedAndProgramExtendedPipeContro ASSERT_NE(cmdList.end(), itor); auto cmdSba = genCmdCast(*itor); - - auto dsh = commandContainer.getIndirectHeap(NEO::HeapType::DYNAMIC_STATE); + if constexpr (FamilyType::supportsSampler) { + auto dsh = commandContainer.getIndirectHeap(NEO::HeapType::DYNAMIC_STATE); + EXPECT_TRUE(cmdSba->getDynamicStateBaseAddressModifyEnable()); + EXPECT_TRUE(cmdSba->getDynamicStateBufferSizeModifyEnable()); + EXPECT_EQ(dsh->getHeapGpuBase(), cmdSba->getDynamicStateBaseAddress()); + EXPECT_EQ(dsh->getHeapSizeInPages(), cmdSba->getDynamicStateBufferSize()); + } else { + EXPECT_FALSE(cmdSba->getDynamicStateBaseAddressModifyEnable()); + EXPECT_FALSE(cmdSba->getDynamicStateBufferSizeModifyEnable()); + } auto ssh = commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE); - - EXPECT_TRUE(cmdSba->getDynamicStateBaseAddressModifyEnable()); - EXPECT_TRUE(cmdSba->getDynamicStateBufferSizeModifyEnable()); - EXPECT_EQ(dsh->getHeapGpuBase(), cmdSba->getDynamicStateBaseAddress()); - EXPECT_EQ(dsh->getHeapSizeInPages(), cmdSba->getDynamicStateBufferSize()); - EXPECT_TRUE(cmdSba->getSurfaceStateBaseAddressModifyEnable()); EXPECT_EQ(ssh->getHeapGpuBase(), cmdSba->getSurfaceStateBaseAddress()); diff --git a/opencl/source/command_queue/enqueue_common.h b/opencl/source/command_queue/enqueue_common.h index 4c558ab060..2bb3d68855 100644 --- a/opencl/source/command_queue/enqueue_common.h +++ b/opencl/source/command_queue/enqueue_common.h @@ -827,9 +827,9 @@ CompletionStamp CommandQueueHw::enqueueNonBlocked( CompletionStamp completionStamp = getGpgpuCommandStreamReceiver().flushTask( commandStream, commandStreamStart, - *dsh, - *ioh, - getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), + dsh, + ioh, + &getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), taskLevel, dispatchFlags, getDevice()); @@ -1035,9 +1035,9 @@ CompletionStamp CommandQueueHw::enqueueCommandWithoutKernel( completionStamp = getGpgpuCommandStreamReceiver().flushTask( *commandStream, commandStreamStart, - getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), - getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), - getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), + &getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), + &getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), + &getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), taskLevel, dispatchFlags, getDevice()); diff --git a/opencl/source/helpers/task_information.cpp b/opencl/source/helpers/task_information.cpp index 3a14b69a60..b1f8416bcb 100644 --- a/opencl/source/helpers/task_information.cpp +++ b/opencl/source/helpers/task_information.cpp @@ -90,9 +90,9 @@ CompletionStamp &CommandMapUnmap::submit(uint32_t taskLevel, bool terminated) { completionStamp = commandStreamReceiver.flushTask(queueCommandStream, offset, - commandQueue.getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), - commandQueue.getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), - commandQueue.getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), + &commandQueue.getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), + &commandQueue.getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), + &commandQueue.getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), taskLevel, dispatchFlags, commandQueue.getDevice()); @@ -250,9 +250,9 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate completionStamp = commandStreamReceiver.flushTask(*kernelOperation->commandStream, 0, - *dsh, - *ioh, - *ssh, + dsh, + ioh, + ssh, taskLevel, dispatchFlags, commandQueue.getDevice()); @@ -389,9 +389,9 @@ CompletionStamp &CommandWithoutKernel::submit(uint32_t taskLevel, bool terminate completionStamp = commandStreamReceiver.flushTask(*kernelOperation->commandStream, 0, - commandQueue.getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), - commandQueue.getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), - commandQueue.getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), + &commandQueue.getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), + &commandQueue.getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), + &commandQueue.getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), taskLevel, dispatchFlags, commandQueue.getDevice()); diff --git a/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp b/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp index 026830b966..5c5f99ccc3 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp @@ -386,9 +386,9 @@ struct StaticWalkerPartitionFourTilesTests : EnqueueWithWalkerPartitionFourTiles dispatchFlags.guardCommandBufferWithPipeControl = true; rootCsr->flushTask(stream, 0, - rootCsr->getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), - rootCsr->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), - rootCsr->getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), + &rootCsr->getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), + &rootCsr->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), + &rootCsr->getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), 0u, dispatchFlags, rootDevice->getDevice()); rootCsr->flushBatchedSubmissions(); diff --git a/opencl/test/unit_test/aub_tests/command_stream/aub_mi_atomic_tests.cpp b/opencl/test/unit_test/aub_tests/command_stream/aub_mi_atomic_tests.cpp index 431b0d9b05..afc9cf33d2 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/aub_mi_atomic_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_stream/aub_mi_atomic_tests.cpp @@ -69,9 +69,9 @@ struct MiAtomicAubFixture : public AUBFixture { csr->makeResident(*deviceSurface); csr->makeResident(*systemSurface); csr->flushTask(taskStream, 0, - csr->getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), - csr->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), - csr->getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), + &csr->getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), + &csr->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), + &csr->getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), 0u, dispatchFlags, device->getDevice()); csr->flushBatchedSubmissions(); diff --git a/opencl/test/unit_test/aub_tests/command_stream/aub_range_based_flush_tests_xehp_and_later.cpp b/opencl/test/unit_test/aub_tests/command_stream/aub_range_based_flush_tests_xehp_and_later.cpp index f14b658e00..b9c8451d08 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/aub_range_based_flush_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_stream/aub_range_based_flush_tests_xehp_and_later.cpp @@ -107,9 +107,9 @@ HWTEST2_F(RangeBasedFlushTest, givenNoDcFlushInPipeControlWhenL3ControlFlushesCa DebugManager.flags.DisableDcFlushInEpilogue.set(true); csr.flushTask(l3FlushCmdStream, offset, - pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::DYNAMIC_STATE, 0), - pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::INDIRECT_OBJECT, 0), - pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::SURFACE_STATE, 0), + &pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::DYNAMIC_STATE, 0), + &pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::INDIRECT_OBJECT, 0), + &pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::SURFACE_STATE, 0), pCmdQ->taskLevel, flags, pCmdQ->getDevice()); @@ -203,9 +203,9 @@ HWTEST2_F(RangeBasedFlushTest, givenL3ControlWhenPostSyncIsSetThenExpectPostSync DebugManager.flags.DisableDcFlushInEpilogue.set(true); csr.makeResident(*postSyncBuffer->getGraphicsAllocation(rootDeviceIndex)); csr.flushTask(l3FlushCmdStream, offset, - pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::DYNAMIC_STATE, 0), - pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::INDIRECT_OBJECT, 0), - pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::SURFACE_STATE, 0), + &pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::DYNAMIC_STATE, 0), + &pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::INDIRECT_OBJECT, 0), + &pCmdQ->getIndirectHeap(NEO::IndirectHeap::Type::SURFACE_STATE, 0), pCmdQ->taskLevel, flags, pCmdQ->getDevice()); diff --git a/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp b/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp index 4c74628a7a..7e7b78526a 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp @@ -240,9 +240,9 @@ struct AubWalkerPartitionZeroFixture : public AubWalkerPartitionFixture { csr->makeResident(*helperSurface); csr->flushTask(*taskStream, 0, - csr->getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), - csr->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), - csr->getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), + &csr->getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), + &csr->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), + &csr->getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), 0u, dispatchFlags, device->getDevice()); csr->flushBatchedSubmissions(); diff --git a/opencl/test/unit_test/aub_tests/command_stream/mi_math_aub_tests_dg2_and_later.cpp b/opencl/test/unit_test/aub_tests/command_stream/mi_math_aub_tests_dg2_and_later.cpp index 8c8dd41685..674b9e1fe2 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/mi_math_aub_tests_dg2_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_stream/mi_math_aub_tests_dg2_and_later.cpp @@ -43,9 +43,9 @@ struct MiMath : public AUBFixture, public ::testing::Test { dispatchFlags.guardCommandBufferWithPipeControl = true; csr->flushTask(*taskStream, 0, - csr->getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), - csr->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), - csr->getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), + &csr->getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 0u), + &csr->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, 0u), + &csr->getIndirectHeap(IndirectHeap::Type::SURFACE_STATE, 0u), 0u, dispatchFlags, device->getDevice()); csr->flushBatchedSubmissions(); diff --git a/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp index e25de8d126..5448c9f04f 100644 --- a/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_handler_tests.cpp @@ -491,7 +491,10 @@ HWTEST2_F(EnqueueHandlerTest, givenEnqueueHandlerWhenAddPatchInfoCommentsForAUBD PatchInfoData patchInfoData = {0xaaaaaaaa, 0, PatchInfoAllocationType::KernelArg, 0xbbbbbbbb, 0, PatchInfoAllocationType::IndirectObjectHeap}; mockKernel.mockKernel->getPatchInfoDataList().push_back(patchInfoData); - constexpr uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 8 : 7; + uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 8 : 7; + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages) { + --expectedCallsCount; + } mockCmdQ->enqueueKernel(mockKernel.mockKernel, 1, nullptr, gws, nullptr, 0, nullptr, nullptr); EXPECT_EQ(expectedCallsCount, mockHelper->setPatchInfoDataCalled); diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp index 706d5079ca..e0dd182760 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp @@ -773,6 +773,7 @@ HWTEST_F(EnqueueKernelTest, givenCommandStreamReceiverInBatchingModeWhenEnqueueK //Three more surfaces from preemptionAllocation, SipKernel and clearColorAllocation size_t csrSurfaceCount = (pDevice->getPreemptionMode() == PreemptionMode::MidThread) ? 2 : 0; + csrSurfaceCount -= pDevice->getHardwareInfo().capabilityTable.supportsImages ? 0 : 1; size_t timestampPacketSurfacesCount = mockCsr->peekTimestampPacketWriteEnabled() ? 1 : 0; size_t fenceSurfaceCount = mockCsr->globalFenceAllocation ? 1 : 0; size_t clearColorSize = mockCsr->clearColorAllocation ? 1 : 0; diff --git a/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp index a4205d2b49..841fc9c05b 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp @@ -164,7 +164,7 @@ struct CreateAllocationForHostSurfaceCsr : public CommandStreamReceiverHw(0u)}; } diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp index ba3e86ca6c..57864661ba 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_1_tests.cpp @@ -143,9 +143,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenTaskIsSu mockCsr.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -160,9 +160,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrWhenflushTaskThenDshAndIoh mockCsr.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -193,9 +193,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndMidThread mockCsr.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -226,9 +226,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInDefaultModeAndMidThreadP mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -266,9 +266,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, whenFlushThenCommandBufferAlreadyH mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -532,8 +532,11 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenFlushingTaskThenCompletionStam HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenFlushingTaskThenStateBaseAddressIsCorrect) { auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver(); flushTask(commandStreamReceiver); - - EXPECT_FALSE(commandStreamReceiver.dshState.updateAndCheck(&dsh)); + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages) { + EXPECT_TRUE(commandStreamReceiver.dshState.updateAndCheck(&dsh)); + } else { + EXPECT_FALSE(commandStreamReceiver.dshState.updateAndCheck(&dsh)); + } EXPECT_FALSE(commandStreamReceiver.iohState.updateAndCheck(&ioh)); EXPECT_FALSE(commandStreamReceiver.sshState.updateAndCheck(&ssh)); } @@ -831,6 +834,10 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenSizeChangedWhenFlushingTaskTh } HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDshHeapChangeWhenFlushTaskIsCalledThenSbaIsReloaded) { + bool deviceUsesDsh = pDevice->getHardwareInfo().capabilityTable.supportsImages; + if (!deviceUsesDsh) { + GTEST_SKIP(); + } auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver(); configureCSRtoNonDirtyState(false); @@ -1029,9 +1036,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenEnoughMemoryOnlyForPreambleAn commandStreamReceiver.flushTask( commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, flushTaskFlags, *mockDevice); @@ -1126,9 +1133,9 @@ HWTEST_F(CommandStreamReceiverCQFlushTaskTests, WhenGettingCsThenReturnCsWithEno commandStreamReceiver.flushTask( commandStream, 0, - linear, - linear, - linear, + &linear, + &linear, + &linear, 1, dispatchFlags, *pDevice); @@ -1174,9 +1181,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, GivenBlockingWh commandStreamReceiver->flushTask( commandStreamTask, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1218,9 +1225,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, GivenBlockingWh commandStreamReceiver.flushTask( commandStreamTask, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1308,9 +1315,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDispatchFlagsWhenCallFlushTas mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1335,9 +1342,9 @@ HWTEST_P(CommandStreamReceiverFlushTaskMemoryCompressionTests, givenCsrWithMemor mockCsr.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1360,9 +1367,9 @@ HWTEST_P(CommandStreamReceiverFlushTaskMemoryCompressionTests, givenCsrWithMemor MemoryCompressionState lastMemoryCompressionState = mockCsr.lastMemoryCompressionState; mockCsr.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1374,9 +1381,9 @@ HWTEST_P(CommandStreamReceiverFlushTaskMemoryCompressionTests, givenCsrWithMemor mockCsr.lastMemoryCompressionState = memoryCompressionState; mockCsr.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp index 9f4735df71..779d029c6c 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -120,9 +120,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenTaskCsPassedAsCommandStreamPa auto cs = commandStreamReceiver.flushTask( commandStreamTask, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1084,7 +1084,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, GivenPreambleSe commandStreamReceiver.streamProperties.stateComputeMode.setProperties(flushTaskFlags.requiresCoherency, flushTaskFlags.numGrfRequired, flushTaskFlags.threadArbitrationPolicy, *defaultHwInfo); - commandStreamReceiver.flushTask(commandStream, 0, dsh, ioh, ssh, taskLevel, flushTaskFlags, *pDevice); + commandStreamReceiver.flushTask(commandStream, 0, &dsh, &ioh, &ssh, taskLevel, flushTaskFlags, *pDevice); // Verify that we didn't grab a new CS buffer EXPECT_EQ(expectedUsed, csrCS.getUsed()); @@ -1228,9 +1228,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInNonDi mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1257,9 +1257,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInNonDi mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1427,19 +1427,19 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandStreamReceiverWhenFlus DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); - csr->flushTask(cs, 0u, cs, cs, cs, 0u, dispatchFlags, *pDevice); + csr->flushTask(cs, 0u, &cs, &cs, &cs, 0u, dispatchFlags, *pDevice); EXPECT_TRUE(csr->pageTableManagerInitialized); EXPECT_FALSE(csr2->pageTableManagerInitialized); - csr->flushTask(cs, 0u, cs, cs, cs, 0u, dispatchFlags, *pDevice); + csr->flushTask(cs, 0u, &cs, &cs, &cs, 0u, dispatchFlags, *pDevice); EXPECT_EQ(1u, pageTableManager->initContextAuxTableRegisterCalled); EXPECT_EQ(1u, pageTableManager->initContextAuxTableRegisterParamsPassed.size()); EXPECT_EQ(csr, pageTableManager->initContextAuxTableRegisterParamsPassed[0].initialBBHandle); pDevice->resetCommandStreamReceiver(csr2); - csr2->flushTask(cs, 0u, cs, cs, cs, 0u, dispatchFlags, *pDevice); + csr2->flushTask(cs, 0u, &cs, &cs, &cs, 0u, dispatchFlags, *pDevice); EXPECT_TRUE(csr2->pageTableManagerInitialized); memoryManager->freeGraphicsMemory(graphicsAllocation); @@ -1597,11 +1597,11 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandStreamReceiverWhenInit DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); - csr->flushTask(cs, 0u, cs, cs, cs, 0u, dispatchFlags, *pDevice); + csr->flushTask(cs, 0u, &cs, &cs, &cs, 0u, dispatchFlags, *pDevice); EXPECT_FALSE(csr->pageTableManagerInitialized); - csr->flushTask(cs, 0u, cs, cs, cs, 0u, dispatchFlags, *pDevice); + csr->flushTask(cs, 0u, &cs, &cs, &cs, 0u, dispatchFlags, *pDevice); EXPECT_FALSE(csr->pageTableManagerInitialized); memoryManager->freeGraphicsMemory(graphicsAllocation); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp index 1fa9200dae..13051a1086 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_3_tests.cpp @@ -56,9 +56,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -70,6 +70,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas auto cmdBuffer = cmdBufferList.peekHead(); //two more because of preemption allocation and sipKernel in Mid Thread preemption mode size_t csrSurfaceCount = (pDevice->getPreemptionMode() == PreemptionMode::MidThread) ? 2 : 0; + csrSurfaceCount -= pDevice->getHardwareInfo().capabilityTable.supportsImages ? 0 : 1; csrSurfaceCount += mockCsr->globalFenceAllocation ? 1 : 0; csrSurfaceCount += mockCsr->clearColorAllocation ? 1 : 0; @@ -115,18 +116,18 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndTwoRecord mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -184,27 +185,27 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndThreeReco mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -252,9 +253,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndThreeReco mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -263,9 +264,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndThreeReco mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -274,9 +275,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndThreeReco mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -318,9 +319,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -335,9 +336,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas mockCsr->flushTask(commandStream, commandStream.getUsed(), - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -398,9 +399,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenCsrInBatch mockCsr->flushTask(commandStream, 4, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -473,9 +474,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenBlocking mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -527,9 +528,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -559,9 +560,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenUpdateTaskCountFromWaitWhenFl mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -587,9 +588,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInDefaultModeWhenFlushTask csr.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -616,9 +617,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas csr.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -629,9 +630,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas csr.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -643,9 +644,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenFlushTas csr.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -673,9 +674,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenWaitForT mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -714,9 +715,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenEnqueueI mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -755,9 +756,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenSusbsequ mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -776,9 +777,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenSusbsequ mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -821,9 +822,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenTotalRes mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -843,9 +844,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenTotalRes mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -879,9 +880,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); @@ -889,9 +890,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, //now emit with the same taskLevel mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); @@ -955,9 +956,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenDcFlushI mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -985,9 +986,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenCommandA mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1017,9 +1018,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWithOutOfOrd mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1051,9 +1052,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenUpdateTaskCountFromWaitSetAnd mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1082,9 +1083,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenUpdateTaskCountFromWaitSetWhe mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1174,9 +1175,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenDcFlushI mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1208,9 +1209,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenEpiloguePipeControlThenDcFlus mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1248,9 +1249,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenEpiloguePipeControlWhendDcFlu mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1286,9 +1287,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); @@ -1296,9 +1297,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, //now emit with the same taskLevel mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); @@ -1344,8 +1345,8 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndOoqFlagSe auto taskLevelPriorToSubmission = mockCsr->peekTaskLevel(); mockCsr->timestampPacketWriteEnabled = false; - mockCsr->flushTask(commandStream, 0, dsh, ioh, ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); - mockCsr->flushTask(commandStream, 0, dsh, ioh, ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); + mockCsr->flushTask(commandStream, 0, &dsh, &ioh, &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); + mockCsr->flushTask(commandStream, 0, &dsh, &ioh, &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); auto firstCmdBuffer = mockedSubmissionsAggregator->peekCommandBuffers().peekHead(); EXPECT_EQ(nullptr, firstCmdBuffer->pipeControlThatMayBeErasedLocation); @@ -1355,8 +1356,8 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndOoqFlagSe mockCsr->flushBatchedSubmissions(); mockCsr->timestampPacketWriteEnabled = true; - mockCsr->flushTask(commandStream, 0, dsh, ioh, ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); - mockCsr->flushTask(commandStream, 0, dsh, ioh, ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); + mockCsr->flushTask(commandStream, 0, &dsh, &ioh, &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); + mockCsr->flushTask(commandStream, 0, &dsh, &ioh, &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); firstCmdBuffer = mockedSubmissionsAggregator->peekCommandBuffers().peekHead(); EXPECT_NE(nullptr, firstCmdBuffer->pipeControlThatMayBeErasedLocation); @@ -1386,9 +1387,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenPipeCont mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); @@ -1396,9 +1397,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenPipeCont //now emit with the same taskLevel mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); @@ -1449,9 +1450,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); @@ -1459,18 +1460,18 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, //now emit with the same taskLevel mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevelPriorToSubmission, dispatchFlags, *pDevice); @@ -1588,9 +1589,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDispatchFlagsWithThrottleSetT mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1621,9 +1622,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDispatchFlagsWithThrottleSetT mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1671,9 +1672,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDispatchFlagsWithThrottleSetT mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1702,9 +1703,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenEpilogueRe commandStreamReceiver.storeMakeResidentAllocations = true; commandStreamReceiver.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1754,9 +1755,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDispatchFlagsWithNewSliceCoun mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1777,7 +1778,7 @@ class UltCommandStreamReceiverForDispatchFlags : public UltCommandStreamReceiver : BaseClass(executionEnvironment, 0, deviceBitfield) {} CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, const IndirectHeap &ioh, const IndirectHeap &ssh, + const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override { savedDispatchFlags = dispatchFlags; return BaseClass::flushTask(commandStream, commandStreamStart, @@ -1863,9 +1864,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, whenPerDssBackBufferProgrammingEna commandStreamReceiver.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -1884,9 +1885,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, whenPerDssBackBufferProgrammingEna commandStreamReceiver.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_4_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_4_tests.cpp index e8daa5760f..fb75506565 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_4_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_4_tests.cpp @@ -649,9 +649,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenStaticPartitioningEnabledWhen DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); mockCsr.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *device); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp index 59df9e1b2e..653348d803 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_gmock_tests.cpp @@ -78,33 +78,36 @@ HWTEST2_F(CommandStreamReceiverFlushTaskGmockTests, dispatchFlags.guardCommandBufferWithPipeControl = true; dispatchFlags.outOfOrderExecutionAllowed = true; - constexpr uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 10 : 9; + uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 10 : 9; + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages) { + --expectedCallsCount; + } size_t removePatchInfoDataCount = 4 * UltMemorySynchronizationCommands::getExpectedPipeControlCount(pDevice->getHardwareInfo()); mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -143,9 +146,9 @@ HWTEST_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhenA mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -167,13 +170,16 @@ HWTEST2_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCommandStreamerWhen DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); - constexpr uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 4 : 3; + uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 4 : 3; + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages) { + --expectedCallsCount; + } mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -210,18 +216,26 @@ HWTEST2_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCsrWhenCollectState auto mockHelper = new MockFlatBatchBufferHelper(*pDevice->executionEnvironment); mockCsr->overwriteFlatBatchBufferHelper(mockHelper); - constexpr uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 4 : 3; + uint32_t expectedCallsCount = TestTraits::iohInSbaSupported ? 4 : 3; + auto dshPatchIndex = 0u; + auto gshPatchIndex = 1u; + auto sshPatchIndex = 2u; + auto iohPatchIndex = 3u; + const bool deviceUsesDsh = pDevice->getHardwareInfo().capabilityTable.supportsImages; + if (!deviceUsesDsh) { + --expectedCallsCount; + gshPatchIndex = 0u; + sshPatchIndex = 1u; + iohPatchIndex = 2u; + } uint64_t baseAddress = 0xabcdef; uint64_t commandOffset = 0xa; uint64_t generalStateBase = 0xff; - mockCsr->collectStateBaseAddresPatchInfo(baseAddress, commandOffset, dsh, ioh, ssh, generalStateBase); + mockCsr->collectStateBaseAddresPatchInfo(baseAddress, commandOffset, &dsh, &ioh, &ssh, generalStateBase); ASSERT_EQ(mockHelper->patchInfoDataVector.size(), expectedCallsCount); - PatchInfoData dshPatch = mockHelper->patchInfoDataVector[0]; - PatchInfoData gshPatch = mockHelper->patchInfoDataVector[1]; - PatchInfoData sshPatch = mockHelper->patchInfoDataVector[2]; for (auto &patch : mockHelper->patchInfoDataVector) { EXPECT_EQ(patch.targetAllocation, baseAddress); @@ -229,22 +243,27 @@ HWTEST2_F(CommandStreamReceiverFlushTaskGmockTests, givenMockCsrWhenCollectState } //DSH - EXPECT_EQ(dshPatch.sourceAllocation, dsh.getGraphicsAllocation()->getGpuAddress()); - EXPECT_EQ(dshPatch.targetAllocationOffset, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::DYNAMICSTATEBASEADDRESS_BYTEOFFSET); + if (deviceUsesDsh) { + PatchInfoData dshPatch = mockHelper->patchInfoDataVector[dshPatchIndex]; + EXPECT_EQ(dshPatch.sourceAllocation, dsh.getGraphicsAllocation()->getGpuAddress()); + EXPECT_EQ(dshPatch.targetAllocationOffset, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::DYNAMICSTATEBASEADDRESS_BYTEOFFSET); + } if constexpr (TestTraits::iohInSbaSupported) { //IOH - PatchInfoData iohPatch = mockHelper->patchInfoDataVector[3]; + PatchInfoData iohPatch = mockHelper->patchInfoDataVector[iohPatchIndex]; EXPECT_EQ(iohPatch.sourceAllocation, ioh.getGraphicsAllocation()->getGpuAddress()); EXPECT_EQ(iohPatch.targetAllocationOffset, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::INDIRECTOBJECTBASEADDRESS_BYTEOFFSET); } //SSH + PatchInfoData sshPatch = mockHelper->patchInfoDataVector[sshPatchIndex]; EXPECT_EQ(sshPatch.sourceAllocation, ssh.getGraphicsAllocation()->getGpuAddress()); EXPECT_EQ(sshPatch.targetAllocationOffset, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::SURFACESTATEBASEADDRESS_BYTEOFFSET); //GSH + PatchInfoData gshPatch = mockHelper->patchInfoDataVector[gshPatchIndex]; EXPECT_EQ(gshPatch.sourceAllocation, generalStateBase); EXPECT_EQ(gshPatch.targetAllocationOffset, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::GENERALSTATEBASEADDRESS_BYTEOFFSET); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp index daf7adaee6..aa42de6f9b 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_tests_xehp_and_later.cpp @@ -71,7 +71,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, wh auto offset = commandStreamReceiver.getCS(0).getUsed(); // make SBA dirty (using ioh as dsh and dsh as ioh just to force SBA reprogramming) - commandStreamReceiver.flushTask(commandStream, 0, ioh, dsh, ssh, taskLevel, flushTaskFlags, *pDevice); + commandStreamReceiver.flushTask(commandStream, 0, &ioh, &dsh, &ssh, taskLevel, flushTaskFlags, *pDevice); HardwareParse hwParser; hwParser.parseCommands(commandStreamReceiver.getCS(0), offset); @@ -238,9 +238,9 @@ HWTEST2_F(CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenProgramExtendedP commandStreamReceiver.flushTask( commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, flushTaskFlags, *mockDevice); @@ -677,9 +677,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, Gi commandStreamReceiver->flushTask( commandStreamTask, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -715,9 +715,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -744,9 +744,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi mockCsr->flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -785,9 +785,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi mockCsr->flushTask(commandStream, 4, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -803,6 +803,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi //preemption allocation + sip kernel size_t csrSurfaceCount = (pDevice->getPreemptionMode() == PreemptionMode::MidThread) ? 2 : 0; + csrSurfaceCount -= pDevice->getHardwareInfo().capabilityTable.supportsImages ? 0 : 1; csrSurfaceCount += mockCsr->globalFenceAllocation ? 1 : 0; csrSurfaceCount += mockCsr->clearColorAllocation ? 1 : 0; @@ -865,9 +866,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi commandStreamReceiver.storeMakeResidentAllocations = true; commandStreamReceiver.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp index b7cbd715d6..28e19d0a94 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp @@ -61,9 +61,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, UltCommandStreamReceiverTest, givenNotSentStateSipWh csr.flushTask(commandStream, 0, - heap, - heap, - heap, + &heap, + &heap, + &heap, 0, dispatchFlags, mockDevice->getDevice()); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp index 4f98048e8b..d36a975eb1 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests_dg2_and_later.cpp @@ -100,9 +100,9 @@ HWTEST2_F(CommandStreamReceiverFlushTaskDg2AndLaterTests, givenProgramExtendedPi auto cmdSizeForAllCommands = commandStreamReceiver.getRequiredCmdStreamSize(dispatchFlags, *pDevice); commandStreamReceiver.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); @@ -131,9 +131,9 @@ HWTEST2_F(CommandStreamReceiverFlushTaskDg2AndLaterTests, givenProgramExtendedPi commandStreamReceiver.flushTask(commandStream, 0, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, *pDevice); diff --git a/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h b/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h index 2deaf1fb2e..27a57128da 100644 --- a/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h +++ b/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h @@ -94,9 +94,9 @@ struct UltCommandStreamReceiverTest return commandStreamReceiver.flushTask( commandStream, startOffset, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, flushTaskFlags, *pDevice); diff --git a/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp b/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp index 2074d07a2e..f3ca677fbd 100644 --- a/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp +++ b/opencl/test/unit_test/gen11/coherency_tests_gen11.cpp @@ -96,7 +96,7 @@ struct Gen11CoherencyProgramingTest : public Gen11CoherencyRequirements { IndirectHeap stream(graphicAlloc); startOffset = csr->commandStream.getUsed(); - csr->flushTask(stream, 0, stream, stream, stream, 0, flags, *device); + csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device); csr->getMemoryManager()->freeGraphicsMemory(graphicAlloc); }; diff --git a/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl index 7150b7dc3e..aa02958dd0 100644 --- a/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl @@ -212,7 +212,7 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, givenCoherencyRequirementWithoutShar auto flushTask = [&](bool coherencyRequired) { flags.requiresCoherency = coherencyRequired; startOffset = csr->commandStream.getUsed(); - csr->flushTask(stream, 0, stream, stream, stream, 0, flags, *device); + csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device); }; auto findCmd = [&](bool expectToBeProgrammed, bool expectCoherent, bool expectPipeControl) { @@ -266,7 +266,7 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, givenSharedHandlesWhenFlushTaskCalle makeResidentSharedAlloc(); startOffset = csr->commandStream.getUsed(); - csr->flushTask(stream, 0, stream, stream, stream, 0, flags, *device); + csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device); }; auto flushTaskAndFindCmds = [&](bool expectCoherent, bool valueChanged) { @@ -302,12 +302,12 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, givenFlushWithoutSharedHandlesWhenPr IndirectHeap stream(graphicAlloc); makeResidentSharedAlloc(); - csr->flushTask(stream, 0, stream, stream, stream, 0, flags, *device); + csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device); EXPECT_TRUE(csr->getCsrRequestFlags()->hasSharedHandles); auto startOffset = csr->commandStream.getUsed(); csr->streamProperties.stateComputeMode.isCoherencyRequired.set(true); - csr->flushTask(stream, 0, stream, stream, stream, 0, flags, *device); + csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device); EXPECT_TRUE(csr->getCsrRequestFlags()->hasSharedHandles); HardwareParse hwParser; diff --git a/opencl/test/unit_test/helpers/task_information_tests.cpp b/opencl/test/unit_test/helpers/task_information_tests.cpp index 0b48a1915e..1093510135 100644 --- a/opencl/test/unit_test/helpers/task_information_tests.cpp +++ b/opencl/test/unit_test/helpers/task_information_tests.cpp @@ -220,8 +220,8 @@ template class MockCsr1 : public CommandStreamReceiverHw { public: CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, const IndirectHeap &ioh, - const IndirectHeap &ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override { + const IndirectHeap *dsh, const IndirectHeap *ioh, + const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override { passedDispatchFlags = dispatchFlags; return CompletionStamp(); } diff --git a/opencl/test/unit_test/helpers/timestamp_packet_2_tests.cpp b/opencl/test/unit_test/helpers/timestamp_packet_2_tests.cpp index 6bc9f6bcaa..9fb750f482 100644 --- a/opencl/test/unit_test/helpers/timestamp_packet_2_tests.cpp +++ b/opencl/test/unit_test/helpers/timestamp_packet_2_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -52,9 +52,9 @@ class MockCommandStreamReceiverHW : public UltCommandStreamReceiver CompletionStamp flushTask( LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, - const IndirectHeap &ioh, - const IndirectHeap &ssh, + const IndirectHeap *dsh, + const IndirectHeap *ioh, + const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override { diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index cd874fff68..02e75289aa 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -546,9 +546,9 @@ class CommandStreamReceiverMock : public CommandStreamReceiver { CompletionStamp flushTask( LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, - const IndirectHeap &ioh, - const IndirectHeap &ssh, + const IndirectHeap *dsh, + const IndirectHeap *ioh, + const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override { diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp index fd315b421e..667bf42603 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp @@ -483,7 +483,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamBatchingTests, givenCsrWhenDispatchPolicyIsSe DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); dispatchFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(device->getHardwareInfo()); - csr->flushTask(cs, 0u, cs, cs, cs, 0u, dispatchFlags, *device); + csr->flushTask(cs, 0u, &cs, &cs, &cs, 0u, dispatchFlags, *device); //make sure command buffer is recorded auto &cmdBuffers = mockedSubmissionsAggregator->peekCommandBuffers(); @@ -549,7 +549,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamBatchingTests, givenRecordedCommandBufferWhen dispatchFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(device->getHardwareInfo()); dispatchFlags.guardCommandBufferWithPipeControl = true; - csr->flushTask(cs, 0u, cs, cs, cs, 0u, dispatchFlags, *device); + csr->flushTask(cs, 0u, &cs, &cs, &cs, 0u, dispatchFlags, *device); auto &cmdBuffers = mockedSubmissionsAggregator->peekCommandBuffers(); auto storedCommandBuffer = cmdBuffers.peekHead(); diff --git a/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp b/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp index 5d1d54fed2..1c0bbdf24a 100644 --- a/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -133,9 +133,9 @@ HWTEST_F(clCreateCommandQueueWithPropertiesLinux, givenPropertiesWithClQueueSlic mockCsr->flushTask(commandStream, 0u, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, mdevice->getDevice()); @@ -180,9 +180,9 @@ HWTEST_F(clCreateCommandQueueWithPropertiesLinux, givenSameSliceCountAsRecentlyS mockCsr->lastSentSliceCount = newSliceCount; mockCsr->flushTask(commandStream, 0u, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, mdevice->getDevice()); @@ -225,9 +225,9 @@ HWTEST_F(clCreateCommandQueueWithPropertiesLinux, givenPropertiesWithClQueueSlic auto lastSliceCountBeforeFlushTask = mockCsr->lastSentSliceCount; mockCsr->flushTask(commandStream, 0u, - dsh, - ioh, - ssh, + &dsh, + &ioh, + &ssh, taskLevel, dispatchFlags, mdevice->getDevice()); diff --git a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp index 635a2d77b9..12ace602e3 100644 --- a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp @@ -880,7 +880,7 @@ HWTEST_F(WddmCommandStreamMockGdiTest, givenRecordedCommandBufferWhenItIsSubmitt dispatchFlags.guardCommandBufferWithPipeControl = true; dispatchFlags.requiresCoherency = true; - csr->flushTask(cs, 0u, dsh, ioh, ssh, 0u, dispatchFlags, *device); + csr->flushTask(cs, 0u, &dsh, &ioh, &ssh, 0u, dispatchFlags, *device); auto &cmdBuffers = mockedSubmissionsAggregator->peekCommandBuffers(); auto storedCommandBuffer = cmdBuffers.peekHead(); @@ -891,6 +891,7 @@ HWTEST_F(WddmCommandStreamMockGdiTest, givenRecordedCommandBufferWhenItIsSubmitt csr->flushBatchedSubmissions(); csrSurfaceCount += csr->clearColorAllocation ? 1 : 0; + csrSurfaceCount -= device->getHardwareInfo().capabilityTable.supportsImages ? 0 : 1; EXPECT_TRUE(cmdBuffers.peekIsEmpty()); EXPECT_EQ(1u, wddm->submitResult.called); @@ -1043,7 +1044,7 @@ HWTEST_F(WddmCsrCompressionTests, givenDisabledCompressionWhenFlushingThenDontIn DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); - mockWddmCsr->flushTask(cs, 0u, cs, cs, cs, 0u, dispatchFlags, *device); + mockWddmCsr->flushTask(cs, 0u, &cs, &cs, &cs, 0u, dispatchFlags, *device); for (auto engine : memoryManager->getRegisteredEngines()) { EXPECT_EQ(nullptr, engine.commandStreamReceiver->pageTableManager.get()); diff --git a/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp b/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp index 98494cb266..e9e8f84beb 100644 --- a/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp +++ b/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -39,9 +39,9 @@ HWTEST_F(CommandStreamReceiverWithActiveDebuggerTest, givenCsrWithActiveDebugger mockCsr->flushTask(commandStream, 0, - *heap.get(), - *heap.get(), - *heap.get(), + heap.get(), + heap.get(), + heap.get(), 0, dispatchFlags, baseDevice); @@ -80,9 +80,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverWithActiveDebuggerTest, givenCs mockCsr->flushTask(commandStream, 0, - *heap.get(), - *heap.get(), - *heap.get(), + heap.get(), + heap.get(), + heap.get(), 0, dispatchFlags, baseDevice); @@ -132,9 +132,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverWithActiveDebuggerTest, givenCs mockCsr->flushTask(commandStream, 0, - *heap.get(), - *heap.get(), - *heap.get(), + heap.get(), + heap.get(), + heap.get(), 0, dispatchFlags, baseDevice); @@ -143,9 +143,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverWithActiveDebuggerTest, givenCs mockCsr->flushTask(commandStream, 0, - *heap.get(), - *heap.get(), - *heap.get(), + heap.get(), + heap.get(), + heap.get(), 0, dispatchFlags, baseDevice); diff --git a/opencl/test/unit_test/xe_hp_core/xehp/source_level_debugger_csr_tests_xehp.cpp b/opencl/test/unit_test/xe_hp_core/xehp/source_level_debugger_csr_tests_xehp.cpp index 3f9a4ab1ab..07cd0d0ff6 100644 --- a/opencl/test/unit_test/xe_hp_core/xehp/source_level_debugger_csr_tests_xehp.cpp +++ b/opencl/test/unit_test/xe_hp_core/xehp/source_level_debugger_csr_tests_xehp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -49,9 +49,9 @@ XEHPTEST_F(CommandStreamReceiverWithActiveDebuggerXehpTest, GivenASteppingAndAct mockCsr->flushTask(commandStream, 0, - *heap.get(), - *heap.get(), - *heap.get(), + heap.get(), + heap.get(), + heap.get(), 0, dispatchFlags, neoDevice); @@ -66,9 +66,9 @@ XEHPTEST_F(CommandStreamReceiverWithActiveDebuggerXehpTest, GivenASteppingAndAct mockCsr->flushTask(commandStream, 0, - *heap.get(), - *heap.get(), - *heap.get(), + heap.get(), + heap.get(), + heap.get(), 0, dispatchFlags, neoDevice); diff --git a/shared/source/command_container/cmdcontainer.cpp b/shared/source/command_container/cmdcontainer.cpp index a3f44b7034..ffffb76a9e 100644 --- a/shared/source/command_container/cmdcontainer.cpp +++ b/shared/source/command_container/cmdcontainer.cpp @@ -87,6 +87,9 @@ ErrorCode CommandContainer::initialize(Device *device, AllocationsList *reusable if (NEO::ApiSpecificConfig::getBindlessConfiguration() && i != IndirectHeap::Type::INDIRECT_OBJECT) { continue; } + if (!hardwareInfo.capabilityTable.supportsImages && IndirectHeap::Type::DYNAMIC_STATE == i) { + continue; + } allocationIndirectHeaps[i] = heapHelper->getHeapAllocation(i, heapSize, alignedSize, diff --git a/shared/source/command_container/command_encoder_xehp_and_later.inl b/shared/source/command_container/command_encoder_xehp_and_later.inl index a59391c553..96ad646004 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -121,29 +121,30 @@ void EncodeDispatchKernel::encode(CommandContainer &container, PreemptionHelper::programInterfaceDescriptorDataPreemption(&idd, args.preemptionMode); - auto heap = ApiSpecificConfig::getBindlessConfiguration() ? args.device->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH) : container.getIndirectHeap(HeapType::DYNAMIC_STATE); - UNRECOVERABLE_IF(!heap); - - uint32_t samplerStateOffset = 0; - uint32_t samplerCount = 0; - - if (kernelDescriptor.payloadMappings.samplerTable.numSamplers > 0) { - samplerCount = kernelDescriptor.payloadMappings.samplerTable.numSamplers; - samplerStateOffset = EncodeStates::copySamplerState( - heap, kernelDescriptor.payloadMappings.samplerTable.tableOffset, - kernelDescriptor.payloadMappings.samplerTable.numSamplers, kernelDescriptor.payloadMappings.samplerTable.borderColor, - args.dispatchInterface->getDynamicStateHeapData(), - args.device->getBindlessHeapsHelper(), hwInfo); - if (ApiSpecificConfig::getBindlessConfiguration()) { - container.getResidencyContainer().push_back(args.device->getBindlessHeapsHelper()->getHeap(NEO::BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH)->getGraphicsAllocation()); - } - } - if constexpr (Family::supportsSampler) { - idd.setSamplerStatePointer(samplerStateOffset); - } + auto heap = ApiSpecificConfig::getBindlessConfiguration() ? args.device->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH) : container.getIndirectHeap(HeapType::DYNAMIC_STATE); + UNRECOVERABLE_IF(!heap); - EncodeDispatchKernel::adjustBindingTablePrefetch(idd, samplerCount, bindingTableStateCount); + uint32_t samplerStateOffset = 0; + uint32_t samplerCount = 0; + + if (kernelDescriptor.payloadMappings.samplerTable.numSamplers > 0) { + samplerCount = kernelDescriptor.payloadMappings.samplerTable.numSamplers; + samplerStateOffset = EncodeStates::copySamplerState( + heap, kernelDescriptor.payloadMappings.samplerTable.tableOffset, + kernelDescriptor.payloadMappings.samplerTable.numSamplers, kernelDescriptor.payloadMappings.samplerTable.borderColor, + args.dispatchInterface->getDynamicStateHeapData(), + args.device->getBindlessHeapsHelper(), hwInfo); + if (ApiSpecificConfig::getBindlessConfiguration()) { + container.getResidencyContainer().push_back(args.device->getBindlessHeapsHelper()->getHeap(NEO::BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH)->getGraphicsAllocation()); + } + } + + idd.setSamplerStatePointer(samplerStateOffset); + EncodeDispatchKernel::adjustBindingTablePrefetch(idd, samplerCount, bindingTableStateCount); + } else { + EncodeDispatchKernel::adjustBindingTablePrefetch(idd, 0u, bindingTableStateCount); + } uint64_t offsetThreadData = 0u; const uint32_t inlineDataSize = sizeof(INLINE_DATA); diff --git a/shared/source/command_stream/command_stream_receiver.h b/shared/source/command_stream/command_stream_receiver.h index b55ea311cf..77b532f877 100644 --- a/shared/source/command_stream/command_stream_receiver.h +++ b/shared/source/command_stream/command_stream_receiver.h @@ -82,7 +82,7 @@ class CommandStreamReceiver { virtual SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) = 0; virtual CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, const IndirectHeap &ioh, const IndirectHeap &ssh, + const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) = 0; virtual bool flushBatchedSubmissions() = 0; diff --git a/shared/source/command_stream/command_stream_receiver_hw.h b/shared/source/command_stream/command_stream_receiver_hw.h index 91051cf7d4..d4896f1edd 100644 --- a/shared/source/command_stream/command_stream_receiver_hw.h +++ b/shared/source/command_stream/command_stream_receiver_hw.h @@ -43,7 +43,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver { SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override; CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, const IndirectHeap &ioh, const IndirectHeap &ssh, + const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override; void forcePipeControl(NEO::LinearStream &commandStreamCSR); @@ -83,9 +83,9 @@ class CommandStreamReceiverHw : public CommandStreamReceiver { void collectStateBaseAddresPatchInfo( uint64_t commandBufferAddress, uint64_t commandOffset, - const LinearStream &dsh, - const LinearStream &ioh, - const LinearStream &ssh, + const LinearStream *dsh, + const LinearStream *ioh, + const LinearStream *ssh, uint64_t generalStateBase); void collectStateBaseAddresIohPatchInfo(uint64_t commandBufferAddress, uint64_t commandOffset, const LinearStream &ioh); diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index db09b52a50..267c061482 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -157,9 +157,9 @@ template CompletionStamp CommandStreamReceiverHw::flushTask( LinearStream &commandStreamTask, size_t commandStreamStartTask, - const IndirectHeap &dsh, - const IndirectHeap &ioh, - const IndirectHeap &ssh, + const IndirectHeap *dsh, + const IndirectHeap *ioh, + const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) { @@ -272,7 +272,7 @@ CompletionStamp CommandStreamReceiverHw::flushTask( bool checkVfeStateDirty = false; if (requiredScratchSize || requiredPrivateScratchSize) { - scratchSpaceController->setRequiredScratchSpace(ssh.getCpuBase(), + scratchSpaceController->setRequiredScratchSpace(ssh->getCpuBase(), 0u, requiredScratchSize, requiredPrivateScratchSize, @@ -337,10 +337,10 @@ CompletionStamp CommandStreamReceiverHw::flushTask( if (stallingCommandsOnNextFlushRequired) { programStallingCommandsForBarrier(commandStreamCSR, dispatchFlags); } - - bool dshDirty = dshState.updateAndCheck(&dsh); - bool iohDirty = iohState.updateAndCheck(&ioh); - bool sshDirty = sshState.updateAndCheck(&ssh); + const bool hasDsh = hwInfo.capabilityTable.supportsImages; + bool dshDirty = hasDsh ? dshState.updateAndCheck(dsh) : false; + bool iohDirty = iohState.updateAndCheck(ioh); + bool sshDirty = sshState.updateAndCheck(ssh); auto isStateBaseAddressDirty = dshDirty || iohDirty || sshDirty || stateBaseAddressDirty; @@ -394,13 +394,13 @@ CompletionStamp CommandStreamReceiverHw::flushTask( auto instructionHeapBaseAddress = getMemoryManager()->getInternalHeapBaseAddress(rootDeviceIndex, getMemoryManager()->isLocalMemoryUsedForIsa(rootDeviceIndex)); StateBaseAddressHelper::programStateBaseAddress( &cmd, - &dsh, - &ioh, - &ssh, + dsh, + ioh, + ssh, newGSHbase, true, mocsIndex, - getMemoryManager()->getInternalHeapBaseAddress(rootDeviceIndex, ioh.getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), + getMemoryManager()->getInternalHeapBaseAddress(rootDeviceIndex, ioh->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()), instructionHeapBaseAddress, 0, true, @@ -419,7 +419,7 @@ CompletionStamp CommandStreamReceiverHw::flushTask( } if (bindingTableBaseAddressRequired) { - StateBaseAddressHelper::programBindingTableBaseAddress(commandStreamCSR, ssh, device.getGmmHelper()); + StateBaseAddressHelper::programBindingTableBaseAddress(commandStreamCSR, *ssh, device.getGmmHelper()); bindingTableBaseAddressRequired = false; } @@ -478,13 +478,14 @@ CompletionStamp CommandStreamReceiverHw::flushTask( if (DebugManager.flags.ForcePipeControlPriorToWalker.get()) { forcePipeControl(commandStreamCSR); } + if (hasDsh) { + auto dshAllocation = dsh->getGraphicsAllocation(); + this->makeResident(*dshAllocation); + dshAllocation->setEvictable(false); + } + auto iohAllocation = ioh->getGraphicsAllocation(); + auto sshAllocation = ssh->getGraphicsAllocation(); - auto dshAllocation = dsh.getGraphicsAllocation(); - auto iohAllocation = ioh.getGraphicsAllocation(); - auto sshAllocation = ssh.getGraphicsAllocation(); - - this->makeResident(*dshAllocation); - dshAllocation->setEvictable(false); this->makeResident(*iohAllocation); this->makeResident(*sshAllocation); iohAllocation->setEvictable(false); @@ -952,21 +953,22 @@ template void CommandStreamReceiverHw::collectStateBaseAddresPatchInfo( uint64_t baseAddress, uint64_t commandOffset, - const LinearStream &dsh, - const LinearStream &ioh, - const LinearStream &ssh, + const LinearStream *dsh, + const LinearStream *ioh, + const LinearStream *ssh, uint64_t generalStateBase) { typedef typename GfxFamily::STATE_BASE_ADDRESS STATE_BASE_ADDRESS; - - PatchInfoData dynamicStatePatchInfo = {dsh.getGraphicsAllocation()->getGpuAddress(), 0u, PatchInfoAllocationType::DynamicStateHeap, baseAddress, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::DYNAMICSTATEBASEADDRESS_BYTEOFFSET, PatchInfoAllocationType::Default}; + if constexpr (GfxFamily::supportsSampler) { + PatchInfoData dynamicStatePatchInfo = {dsh->getGraphicsAllocation()->getGpuAddress(), 0u, PatchInfoAllocationType::DynamicStateHeap, baseAddress, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::DYNAMICSTATEBASEADDRESS_BYTEOFFSET, PatchInfoAllocationType::Default}; + flatBatchBufferHelper->setPatchInfoData(dynamicStatePatchInfo); + } PatchInfoData generalStatePatchInfo = {generalStateBase, 0u, PatchInfoAllocationType::GeneralStateHeap, baseAddress, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::GENERALSTATEBASEADDRESS_BYTEOFFSET, PatchInfoAllocationType::Default}; - PatchInfoData surfaceStatePatchInfo = {ssh.getGraphicsAllocation()->getGpuAddress(), 0u, PatchInfoAllocationType::SurfaceStateHeap, baseAddress, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::SURFACESTATEBASEADDRESS_BYTEOFFSET, PatchInfoAllocationType::Default}; + PatchInfoData surfaceStatePatchInfo = {ssh->getGraphicsAllocation()->getGpuAddress(), 0u, PatchInfoAllocationType::SurfaceStateHeap, baseAddress, commandOffset + STATE_BASE_ADDRESS::PATCH_CONSTANTS::SURFACESTATEBASEADDRESS_BYTEOFFSET, PatchInfoAllocationType::Default}; - flatBatchBufferHelper->setPatchInfoData(dynamicStatePatchInfo); flatBatchBufferHelper->setPatchInfoData(generalStatePatchInfo); flatBatchBufferHelper->setPatchInfoData(surfaceStatePatchInfo); - collectStateBaseAddresIohPatchInfo(baseAddress, commandOffset, ioh); + collectStateBaseAddresIohPatchInfo(baseAddress, commandOffset, *ioh); } template diff --git a/shared/test/common/libult/ult_command_stream_receiver.h b/shared/test/common/libult/ult_command_stream_receiver.h index 55dbe10723..4ad745770a 100644 --- a/shared/test/common/libult/ult_command_stream_receiver.h +++ b/shared/test/common/libult/ult_command_stream_receiver.h @@ -161,7 +161,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ } CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, const IndirectHeap &ioh, const IndirectHeap &ssh, + const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override { recordedDispatchFlags = dispatchFlags; this->lastFlushedCommandStream = &commandStream; diff --git a/shared/test/common/mocks/mock_aub_csr.h b/shared/test/common/mocks/mock_aub_csr.h index 321fe0dc33..04e142665b 100644 --- a/shared/test/common/mocks/mock_aub_csr.h +++ b/shared/test/common/mocks/mock_aub_csr.h @@ -62,7 +62,7 @@ struct MockAubCsr : public AUBCommandStreamReceiverHw { using AUBCommandStreamReceiverHw::AUBCommandStreamReceiverHw; CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, const IndirectHeap &ioh, const IndirectHeap &ssh, + const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override { recordedDispatchFlags = dispatchFlags; diff --git a/shared/test/common/mocks/mock_command_stream_receiver.cpp b/shared/test/common/mocks/mock_command_stream_receiver.cpp index 661880df07..f59dc2a1e6 100644 --- a/shared/test/common/mocks/mock_command_stream_receiver.cpp +++ b/shared/test/common/mocks/mock_command_stream_receiver.cpp @@ -16,9 +16,9 @@ SubmissionStatus MockCommandStreamReceiver::flush(BatchBuffer &batchBuffer, Resi CompletionStamp MockCommandStreamReceiver::flushTask( LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, - const IndirectHeap &ioh, - const IndirectHeap &ssh, + const IndirectHeap *dsh, + const IndirectHeap *ioh, + const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) { diff --git a/shared/test/common/mocks/mock_command_stream_receiver.h b/shared/test/common/mocks/mock_command_stream_receiver.h index 428f142289..9b514e4186 100644 --- a/shared/test/common/mocks/mock_command_stream_receiver.h +++ b/shared/test/common/mocks/mock_command_stream_receiver.h @@ -90,9 +90,9 @@ class MockCommandStreamReceiver : public CommandStreamReceiver { CompletionStamp flushTask( LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, - const IndirectHeap &ioh, - const IndirectHeap &ssh, + const IndirectHeap *dsh, + const IndirectHeap *ioh, + const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override; @@ -251,8 +251,8 @@ class MockCsrHw2 : public CommandStreamReceiverHw { } CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, const IndirectHeap &ioh, - const IndirectHeap &ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override { + const IndirectHeap *dsh, const IndirectHeap *ioh, + const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override { passedDispatchFlags = dispatchFlags; recordedCommandBuffer = std::unique_ptr(new CommandBuffer(device)); diff --git a/shared/test/common/mocks/mock_csr.h b/shared/test/common/mocks/mock_csr.h index 9cc766c7d7..7272fd0984 100644 --- a/shared/test/common/mocks/mock_csr.h +++ b/shared/test/common/mocks/mock_csr.h @@ -116,9 +116,9 @@ class MockCsr : public MockCsrBase { CompletionStamp flushTask( LinearStream &commandStream, size_t commandStreamStart, - const IndirectHeap &dsh, - const IndirectHeap &ioh, - const IndirectHeap &ssh, + const IndirectHeap *dsh, + const IndirectHeap *ioh, + const IndirectHeap *ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags, Device &device) override { diff --git a/shared/test/unit_test/command_container/command_container_tests.cpp b/shared/test/unit_test/command_container/command_container_tests.cpp index b12511c0a0..12081b6c6b 100644 --- a/shared/test/unit_test/command_container/command_container_tests.cpp +++ b/shared/test/unit_test/command_container/command_container_tests.cpp @@ -106,13 +106,16 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectA for (uint32_t i = 0; i < HeapType::NUM_TYPES; i++) { HeapType heapType = static_cast(i); auto heap = cmdContainer.getIndirectHeap(heapType); - - if (HeapType::INDIRECT_OBJECT == heapType) { - EXPECT_EQ(AllocationType::INTERNAL_HEAP, heap->getGraphicsAllocation()->getAllocationType()); - EXPECT_NE(0u, heap->getHeapGpuStartOffset()); + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::DYNAMIC_STATE == heapType) { + EXPECT_EQ(heap, nullptr); } else { - EXPECT_EQ(AllocationType::LINEAR_STREAM, heap->getGraphicsAllocation()->getAllocationType()); - EXPECT_EQ(0u, heap->getHeapGpuStartOffset()); + if (HeapType::INDIRECT_OBJECT == heapType) { + EXPECT_EQ(AllocationType::INTERNAL_HEAP, heap->getGraphicsAllocation()->getAllocationType()); + EXPECT_NE(0u, heap->getHeapGpuStartOffset()); + } else { + EXPECT_EQ(AllocationType::LINEAR_STREAM, heap->getGraphicsAllocation()->getAllocationType()); + EXPECT_EQ(0u, heap->getHeapGpuStartOffset()); + } } } } @@ -128,9 +131,14 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIs EXPECT_NE(cmdContainer.getCommandStream(), nullptr); for (uint32_t i = 0; i < HeapType::NUM_TYPES; i++) { - auto indirectHeap = cmdContainer.getIndirectHeap(static_cast(i)); - auto heapAllocation = cmdContainer.getIndirectHeapAllocation(static_cast(i)); - EXPECT_EQ(indirectHeap->getGraphicsAllocation(), heapAllocation); + auto heapType = static_cast(i); + auto indirectHeap = cmdContainer.getIndirectHeap(heapType); + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::DYNAMIC_STATE == heapType) { + EXPECT_EQ(indirectHeap, nullptr); + } else { + auto heapAllocation = cmdContainer.getIndirectHeapAllocation(heapType); + EXPECT_EQ(indirectHeap->getGraphicsAllocation(), heapAllocation); + } } EXPECT_EQ(cmdContainer.getIddBlock(), nullptr); @@ -247,12 +255,17 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenSettingIndirectHeapAllocat TEST_F(CommandContainerTest, givenHeapAllocationsWhenDestroyCommandContainerThenHeapAllocationsAreReused) { std::unique_ptr cmdContainer(new CommandContainer); cmdContainer->initialize(pDevice, nullptr, true); - auto heapAllocationsAddress = cmdContainer->getIndirectHeapAllocation(HeapType::DYNAMIC_STATE)->getUnderlyingBuffer(); + auto heapAllocationsAddress = cmdContainer->getIndirectHeapAllocation(HeapType::SURFACE_STATE)->getUnderlyingBuffer(); cmdContainer.reset(new CommandContainer); cmdContainer->initialize(pDevice, nullptr, true); - bool status = false; + bool status = true; for (uint32_t i = 0; i < HeapType::NUM_TYPES && !status; i++) { - status = cmdContainer->getIndirectHeapAllocation(static_cast(i))->getUnderlyingBuffer() == heapAllocationsAddress; + auto heapType = static_cast(i); + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::DYNAMIC_STATE == heapType) { + status = status && cmdContainer->getIndirectHeapAllocation(heapType) == nullptr; + } else { + status = status && cmdContainer->getIndirectHeapAllocation(heapType)->getUnderlyingBuffer() == heapAllocationsAddress; + } } EXPECT_TRUE(status); } @@ -336,30 +349,34 @@ TEST_F(CommandContainerTest, givenAvailableSpaceWhenGetHeapWithRequiredSizeAndAl std::unique_ptr cmdContainer(new CommandContainer); cmdContainer->initialize(pDevice, nullptr, true); cmdContainer->setDirtyStateForAllHeaps(false); - HeapType types[] = {HeapType::SURFACE_STATE, - HeapType::DYNAMIC_STATE}; + HeapType heapTypes[] = {HeapType::SURFACE_STATE, + HeapType::DYNAMIC_STATE}; - for (auto type : types) { - auto heapAllocation = cmdContainer->getIndirectHeapAllocation(type); - auto heap = cmdContainer->getIndirectHeap(type); + for (auto heapType : heapTypes) { + auto heapAllocation = cmdContainer->getIndirectHeapAllocation(heapType); + auto heap = cmdContainer->getIndirectHeap(heapType); - const size_t sizeRequested = 32; - const size_t alignment = 32; + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::DYNAMIC_STATE == heapType) { + EXPECT_EQ(heap, nullptr); + } else { + const size_t sizeRequested = 32; + const size_t alignment = 32; - EXPECT_GE(heap->getAvailableSpace(), sizeRequested + alignment); - auto sizeBefore = heap->getUsed(); + EXPECT_GE(heap->getAvailableSpace(), sizeRequested + alignment); + auto sizeBefore = heap->getUsed(); - auto heapRequested = cmdContainer->getHeapWithRequiredSizeAndAlignment(type, sizeRequested, alignment); - auto newAllocation = heapRequested->getGraphicsAllocation(); + auto heapRequested = cmdContainer->getHeapWithRequiredSizeAndAlignment(heapType, sizeRequested, alignment); + auto newAllocation = heapRequested->getGraphicsAllocation(); - EXPECT_EQ(heap, heapRequested); - EXPECT_EQ(heapAllocation, newAllocation); + EXPECT_EQ(heap, heapRequested); + EXPECT_EQ(heapAllocation, newAllocation); - EXPECT_TRUE((reinterpret_cast(heapRequested->getSpace(0)) & (alignment - 1)) == 0); - EXPECT_FALSE(cmdContainer->isHeapDirty(type)); + EXPECT_TRUE((reinterpret_cast(heapRequested->getSpace(0)) & (alignment - 1)) == 0); + EXPECT_FALSE(cmdContainer->isHeapDirty(heapType)); - auto sizeAfter = heapRequested->getUsed(); - EXPECT_EQ(sizeBefore, sizeAfter); + auto sizeAfter = heapRequested->getUsed(); + EXPECT_EQ(sizeBefore, sizeAfter); + } } } @@ -415,29 +432,33 @@ TEST_F(CommandContainerTest, givenNotEnoughSpaceWhenGetHeapWithRequiredSizeAndAl std::unique_ptr cmdContainer(new CommandContainer); cmdContainer->initialize(pDevice, nullptr, true); cmdContainer->setDirtyStateForAllHeaps(false); - HeapType types[] = {HeapType::SURFACE_STATE, - HeapType::DYNAMIC_STATE}; + HeapType heapTypes[] = {HeapType::SURFACE_STATE, + HeapType::DYNAMIC_STATE}; - for (auto type : types) { - auto heapAllocation = cmdContainer->getIndirectHeapAllocation(type); - auto heap = cmdContainer->getIndirectHeap(type); + for (auto heapType : heapTypes) { + auto heapAllocation = cmdContainer->getIndirectHeapAllocation(heapType); + auto heap = cmdContainer->getIndirectHeap(heapType); - const size_t sizeRequested = 32; - const size_t alignment = 32; - size_t availableSize = heap->getAvailableSpace(); + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::DYNAMIC_STATE == heapType) { + EXPECT_EQ(heap, nullptr); + } else { + const size_t sizeRequested = 32; + const size_t alignment = 32; + size_t availableSize = heap->getAvailableSpace(); - heap->getSpace(availableSize - sizeRequested / 2); + heap->getSpace(availableSize - sizeRequested / 2); - EXPECT_LT(heap->getAvailableSpace(), sizeRequested + alignment); + EXPECT_LT(heap->getAvailableSpace(), sizeRequested + alignment); - auto heapRequested = cmdContainer->getHeapWithRequiredSizeAndAlignment(type, sizeRequested, alignment); - auto newAllocation = heapRequested->getGraphicsAllocation(); + auto heapRequested = cmdContainer->getHeapWithRequiredSizeAndAlignment(heapType, sizeRequested, alignment); + auto newAllocation = heapRequested->getGraphicsAllocation(); - EXPECT_EQ(heap, heapRequested); - EXPECT_NE(heapAllocation, newAllocation); + EXPECT_EQ(heap, heapRequested); + EXPECT_NE(heapAllocation, newAllocation); - EXPECT_TRUE((reinterpret_cast(heapRequested->getSpace(0)) & (alignment - 1)) == 0); - EXPECT_TRUE(cmdContainer->isHeapDirty(type)); + EXPECT_TRUE((reinterpret_cast(heapRequested->getSpace(0)) & (alignment - 1)) == 0); + EXPECT_TRUE(cmdContainer->isHeapDirty(heapType)); + } } for (auto deallocation : cmdContainer->getDeallocationContainer()) { cmdContainer->getDevice()->getMemoryManager()->freeGraphicsMemory(deallocation); @@ -549,40 +570,49 @@ INSTANTIATE_TEST_CASE_P( IndirectHeap::Type::SURFACE_STATE)); TEST_P(CommandContainerHeaps, givenCommandContainerWhenGetAllowHeapGrowCalledThenHeapIsReturned) { - HeapType heap = GetParam(); + HeapType heapType = GetParam(); CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, true); - auto usedSpaceBefore = cmdContainer.getIndirectHeap(heap)->getUsed(); - size_t size = 5000; - void *ptr = cmdContainer.getHeapSpaceAllowGrow(heap, size); - ASSERT_NE(nullptr, ptr); - auto usedSpaceAfter = cmdContainer.getIndirectHeap(heap)->getUsed(); - ASSERT_EQ(usedSpaceBefore + size, usedSpaceAfter); + cmdContainer.initialize(pDevice, nullptr, true); + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::DYNAMIC_STATE == heapType) { + EXPECT_EQ(cmdContainer.getIndirectHeap(heapType), nullptr); + } else { + auto usedSpaceBefore = cmdContainer.getIndirectHeap(heapType)->getUsed(); + size_t size = 5000; + void *ptr = cmdContainer.getHeapSpaceAllowGrow(heapType, size); + ASSERT_NE(nullptr, ptr); + + auto usedSpaceAfter = cmdContainer.getIndirectHeap(heapType)->getUsed(); + ASSERT_EQ(usedSpaceBefore + size, usedSpaceAfter); + } } TEST_P(CommandContainerHeaps, givenCommandContainerWhenGetingMoreThanAvailableSizeThenBiggerHeapIsReturned) { - HeapType heap = GetParam(); + HeapType heapType = GetParam(); CommandContainer cmdContainer; cmdContainer.initialize(pDevice, nullptr, true); cmdContainer.setDirtyStateForAllHeaps(false); + auto heap = cmdContainer.getIndirectHeap(heapType); + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::DYNAMIC_STATE == heapType) { + EXPECT_EQ(heap, nullptr); + } else { + auto usedSpaceBefore = heap->getUsed(); + auto availableSizeBefore = heap->getAvailableSpace(); - auto usedSpaceBefore = cmdContainer.getIndirectHeap(heap)->getUsed(); - auto availableSizeBefore = cmdContainer.getIndirectHeap(heap)->getAvailableSpace(); + void *ptr = cmdContainer.getHeapSpaceAllowGrow(heapType, availableSizeBefore + 1); + ASSERT_NE(nullptr, ptr); - void *ptr = cmdContainer.getHeapSpaceAllowGrow(heap, availableSizeBefore + 1); - ASSERT_NE(nullptr, ptr); - - auto usedSpaceAfter = cmdContainer.getIndirectHeap(heap)->getUsed(); - auto availableSizeAfter = cmdContainer.getIndirectHeap(heap)->getAvailableSpace(); - EXPECT_GT(usedSpaceAfter + availableSizeAfter, usedSpaceBefore + availableSizeBefore); - EXPECT_EQ(!cmdContainer.isHeapDirty(heap), heap == IndirectHeap::Type::INDIRECT_OBJECT); + auto usedSpaceAfter = heap->getUsed(); + auto availableSizeAfter = heap->getAvailableSpace(); + EXPECT_GT(usedSpaceAfter + availableSizeAfter, usedSpaceBefore + availableSizeBefore); + EXPECT_EQ(!cmdContainer.isHeapDirty(heapType), heapType == IndirectHeap::Type::INDIRECT_OBJECT); + } } TEST_P(CommandContainerHeaps, givenCommandContainerForDifferentRootDevicesThenHeapsAreCreatedWithCorrectRootDeviceIndex) { - HeapType heap = GetParam(); + HeapType heapType = GetParam(); auto executionEnvironment = new NEO::ExecutionEnvironment(); const size_t numDevices = 2; @@ -595,13 +625,19 @@ TEST_P(CommandContainerHeaps, givenCommandContainerForDifferentRootDevicesThenHe CommandContainer cmdContainer0; cmdContainer0.initialize(device0.get(), nullptr, true); - uint32_t heapRootDeviceIndex0 = cmdContainer0.getIndirectHeap(heap)->getGraphicsAllocation()->getRootDeviceIndex(); - EXPECT_EQ(device0->getRootDeviceIndex(), heapRootDeviceIndex0); CommandContainer cmdContainer1; cmdContainer1.initialize(device1.get(), nullptr, true); - uint32_t heapRootDeviceIndex1 = cmdContainer1.getIndirectHeap(heap)->getGraphicsAllocation()->getRootDeviceIndex(); - EXPECT_EQ(device1->getRootDeviceIndex(), heapRootDeviceIndex1); + if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::DYNAMIC_STATE == heapType) { + EXPECT_EQ(cmdContainer0.getIndirectHeap(heapType), nullptr); + EXPECT_EQ(cmdContainer1.getIndirectHeap(heapType), nullptr); + } else { + uint32_t heapRootDeviceIndex0 = cmdContainer0.getIndirectHeap(heapType)->getGraphicsAllocation()->getRootDeviceIndex(); + EXPECT_EQ(device0->getRootDeviceIndex(), heapRootDeviceIndex0); + + uint32_t heapRootDeviceIndex1 = cmdContainer1.getIndirectHeap(heapType)->getGraphicsAllocation()->getRootDeviceIndex(); + EXPECT_EQ(device1->getRootDeviceIndex(), heapRootDeviceIndex1); + } } TEST_F(CommandContainerHeaps, givenCommandContainerForDifferentRootDevicesThenCmdBufferAllocationIsCreatedWithCorrectRootDeviceIndex) { diff --git a/shared/test/unit_test/command_stream/compute_mode_tests_xehp_and_later.cpp b/shared/test/unit_test/command_stream/compute_mode_tests_xehp_and_later.cpp index 48b2da25f0..8a3c94cf33 100644 --- a/shared/test/unit_test/command_stream/compute_mode_tests_xehp_and_later.cpp +++ b/shared/test/unit_test/command_stream/compute_mode_tests_xehp_and_later.cpp @@ -215,7 +215,7 @@ HWTEST2_F(ComputeModeRequirements, givenCoherencyRequirementWithoutSharedHandles auto flushTask = [&](bool coherencyRequired) { flags.requiresCoherency = coherencyRequired; startOffset = getCsrHw()->commandStream.getUsed(); - csr->flushTask(stream, 0, stream, stream, stream, 0, flags, *device); + csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device); }; auto findCmd = [&](bool expectToBeProgrammed, bool expectCoherent) { @@ -274,7 +274,7 @@ HWTEST2_F(ComputeModeRequirements, givenCoherencyRequirementWithSharedHandlesWhe makeResidentSharedAlloc(); startOffset = getCsrHw()->commandStream.getUsed(); - csr->flushTask(stream, 0, stream, stream, stream, 0, flags, *device); + csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device); }; auto flushTaskAndFindCmds = [&](bool expectCoherent, bool areCommandsProgrammed) { @@ -319,11 +319,11 @@ HWTEST2_F(ComputeModeRequirements, givenFlushWithoutSharedHandlesWhenPreviouslyU IndirectHeap stream(graphicAlloc); makeResidentSharedAlloc(); - csr->flushTask(stream, 0, stream, stream, stream, 0, flags, *device); + csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device); EXPECT_TRUE(getCsrHw()->getCsrRequestFlags()->hasSharedHandles); auto startOffset = getCsrHw()->commandStream.getUsed(); - csr->flushTask(stream, 0, stream, stream, stream, 0, flags, *device); + csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device); EXPECT_TRUE(getCsrHw()->getCsrRequestFlags()->hasSharedHandles); HardwareParse hwParser; diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp index 3fa1648993..56b36296fc 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp @@ -1190,7 +1190,11 @@ HWTEST_F(BindlessCommandEncodeStatesContainerTest, givenBindlessModeEnabledWhenD EXPECT_EQ(sshBefore, sshAfter); } -HWTEST_F(BindlessCommandEncodeStatesTest, givenGlobalBindlessHeapsWhenDispatchingKernelWithSamplerThenGlobalDshInResidnecyContainer) { +HWTEST_F(BindlessCommandEncodeStatesTest, givenGlobalBindlessHeapsWhenDispatchingKernelWithSamplerThenGlobalDshInResidencyContainer) { + bool deviceUsesDsh = pDevice->getHardwareInfo().capabilityTable.supportsImages; + if (!deviceUsesDsh) { + GTEST_SKIP(); + } DebugManagerStateRestore restorer; DebugManager.flags.UseBindlessMode.set(1); auto cmdContainer = std::make_unique(); diff --git a/shared/test/unit_test/encoders/test_encode_states.cpp b/shared/test/unit_test/encoders/test_encode_states.cpp index 32770a61df..30dc057e1f 100644 --- a/shared/test/unit_test/encoders/test_encode_states.cpp +++ b/shared/test/unit_test/encoders/test_encode_states.cpp @@ -24,6 +24,10 @@ using namespace NEO; using CommandEncodeStatesTest = Test; HWTEST_F(CommandEncodeStatesTest, GivenCommandStreamWhenEncodeCopySamplerStateThenIndirectStatePointerIsCorrect) { + bool deviceUsesDsh = pDevice->getHardwareInfo().capabilityTable.supportsImages; + if (!deviceUsesDsh) { + GTEST_SKIP(); + } using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE; uint32_t numSamplers = 1; SAMPLER_STATE samplerState; @@ -37,6 +41,10 @@ HWTEST_F(CommandEncodeStatesTest, GivenCommandStreamWhenEncodeCopySamplerStateTh } HWTEST2_F(CommandEncodeStatesTest, givenDebugVariableSetWhenCopyingSamplerStateThenSetLowQualityFilterMode, IsAtLeastGen12lp) { + bool deviceUsesDsh = pDevice->getHardwareInfo().capabilityTable.supportsImages; + if (!deviceUsesDsh) { + GTEST_SKIP(); + } using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE; DebugManagerStateRestore restore; @@ -301,7 +309,11 @@ HWTEST2_F(CommandEncodeStatesTest, givenCommandContainerWithDirtyHeapsWhenSetSta auto itorCmd = find(commands.begin(), commands.end()); auto pCmd = genCmdCast(*itorCmd); - EXPECT_EQ(dsh->getHeapGpuBase(), pCmd->getDynamicStateBaseAddress()); + if constexpr (FamilyType::supportsSampler) { + EXPECT_EQ(dsh->getHeapGpuBase(), pCmd->getDynamicStateBaseAddress()); + } else { + EXPECT_EQ(dsh, nullptr); + } EXPECT_EQ(ssh->getHeapGpuBase(), pCmd->getSurfaceStateBaseAddress()); EXPECT_EQ(sba.getDynamicStateBaseAddress(), pCmd->getDynamicStateBaseAddress()); @@ -332,8 +344,11 @@ HWTEST_F(CommandEncodeStatesTest, givenCommandContainerWhenSetStateBaseAddressCa ASSERT_NE(itorCmd, commands.end()); auto cmd = genCmdCast(*itorCmd); - - EXPECT_NE(dsh->getHeapGpuBase(), cmd->getDynamicStateBaseAddress()); + if constexpr (FamilyType::supportsSampler) { + EXPECT_NE(dsh->getHeapGpuBase(), cmd->getDynamicStateBaseAddress()); + } else { + EXPECT_EQ(dsh, nullptr); + } EXPECT_NE(ssh->getHeapGpuBase(), cmd->getSurfaceStateBaseAddress()); } diff --git a/shared/test/unit_test/preemption/preemption_tests.cpp b/shared/test/unit_test/preemption/preemption_tests.cpp index 752e8e3dea..daceb76a0e 100644 --- a/shared/test/unit_test/preemption/preemption_tests.cpp +++ b/shared/test/unit_test/preemption/preemption_tests.cpp @@ -326,9 +326,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, MidThreadPreemptionTests, givenDirtyCsrStateWhenStat csr.flushTask(commandStream, 0, - *heap.get(), - *heap.get(), - *heap.get(), + heap.get(), + heap.get(), + heap.get(), 0, dispatchFlags, *mockDevice); @@ -376,9 +376,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, MidThreadPreemptionTests, WhenProgrammingPreemptionT csr.flushTask(commandStream, 0, - *heap.get(), - *heap.get(), - *heap.get(), + heap.get(), + heap.get(), + heap.get(), 0, dispatchFlags, *mockDevice); diff --git a/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp index 5f9d5407c4..fff24e0209 100644 --- a/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp +++ b/shared/test/unit_test/xe_hpc_core/compute_mode_tests_xe_hpc_core.cpp @@ -165,7 +165,7 @@ HWTEST2_F(XeHpcComputeModeRequirements, giventhreadArbitrationPolicyWithoutShare getCsrHw()->streamProperties.stateComputeMode.threadArbitrationPolicy.value = -1; } startOffset = getCsrHw()->commandStream.getUsed(); - csr->flushTask(stream, 0, stream, stream, stream, 0, flags, *device); + csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device); }; auto findCmd = [&](bool expectToBeProgrammed) {