diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp index 1c23d94388..38a5586f0a 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue.cpp @@ -625,6 +625,9 @@ HWTEST_F(CommandQueueCommandsSingleTile, givenCommandQueueWhenExecutingCommandLi } HWTEST_F(CommandQueueCommandsMultiTile, givenCommandQueueOnMultiTileWhenExecutingCommandListsThenWorkPartitionAllocationIsMadeResident) { + DebugManagerStateRestore restorer; + DebugManager.flags.EnableWalkerPartition.set(1); + class MyCsrMock : public MockCsrHw2 { using MockCsrHw2::MockCsrHw2; @@ -665,6 +668,29 @@ HWTEST_F(CommandQueueCommandsMultiTile, givenCommandQueueOnMultiTileWhenExecutin commandQueue->destroy(); } +HWTEST_F(CommandQueueCommandsMultiTile, givenCommandQueueOnMultiTileWhenWalkerPartitionIsDisabledThenWorkPartitionAllocationIsNotCreated) { + DebugManagerStateRestore restorer; + DebugManager.flags.EnableWalkerPartition.set(0); + + class MyCsrMock : public MockCsrHw2 { + using MockCsrHw2::MockCsrHw2; + + public: + void makeResident(GraphicsAllocation &graphicsAllocation) override { + if (expectedGa == &graphicsAllocation) { + expectedGAWasMadeResident = true; + } + } + GraphicsAllocation *expectedGa = nullptr; + bool expectedGAWasMadeResident = false; + }; + MyCsrMock csr(*neoDevice->getExecutionEnvironment(), 0, neoDevice->getDeviceBitfield()); + csr.initializeTagAllocation(); + csr.createWorkPartitionAllocation(*neoDevice); + auto workPartitionAllocation = csr.getWorkPartitionAllocation(); + EXPECT_EQ(nullptr, workPartitionAllocation); +} + using CommandQueueIndirectAllocations = Test; HWTEST_F(CommandQueueIndirectAllocations, givenCommandQueueWhenExecutingCommandListsThenExpectedIndirectAllocationsAddedToResidencyContainer) { const ze_command_queue_desc_t desc = {}; diff --git a/shared/source/command_stream/command_stream_receiver.cpp b/shared/source/command_stream/command_stream_receiver.cpp index 49b047bbd5..34f350910e 100644 --- a/shared/source/command_stream/command_stream_receiver.cpp +++ b/shared/source/command_stream/command_stream_receiver.cpp @@ -8,6 +8,7 @@ #include "shared/source/command_stream/command_stream_receiver.h" #include "shared/source/built_ins/built_ins.h" +#include "shared/source/command_container/implicit_scaling.h" #include "shared/source/command_stream/experimental_command_buffer.h" #include "shared/source/command_stream/preemption.h" #include "shared/source/command_stream/scratch_space_controller.h" @@ -51,7 +52,7 @@ CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvi } internalAllocationStorage = std::make_unique(*this); - if (deviceBitfield.count() > 1 && DebugManager.flags.EnableStaticPartitioning.get() != 0) { + if (deviceBitfield.count() > 1 && DebugManager.flags.EnableStaticPartitioning.get() != 0 && NEO::ImplicitScalingHelper::isImplicitScalingEnabled(deviceBitfield, true)) { this->staticWorkPartitioningEnabled = true; } }