Skip to content

Commit c769365

Browse files
Fix partition count after command list reset
Related-To: NEO-6262 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
1 parent 5a2a19f commit c769365

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

level_zero/core/source/cmdlist/cmdlist_hw.inl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::reset() {
114114
device->getNEODevice()->getMemoryManager()->freeGraphicsMemory(alloc);
115115
}
116116
this->ownedPrivateAllocations.clear();
117-
partitionCount = 1;
117+
if (device->isImplicitScalingCapable() && !this->internalUsage) {
118+
this->partitionCount = static_cast<uint32_t>(this->device->getNEODevice()->getDeviceBitfield().count());
119+
} else {
120+
this->partitionCount = 1;
121+
}
118122
return ZE_RESULT_SUCCESS;
119123
}
120124

level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -834,20 +834,18 @@ HWTEST2_F(CommandListCreate, whenContainsCooperativeKernelsIsCalledThenCorrectVa
834834
}
835835
}
836836

837-
HWTEST_F(CommandListCreate, whenCommandListIsResetThenPartitionCountIsReversedToOne) {
837+
HWTEST_F(CommandListCreate, GivenSingleTileDeviceWhenCommandListIsResetThenPartitionCountIsReversedToOne) {
838838
ze_result_t returnValue;
839839
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily,
840840
device,
841841
NEO::EngineGroupType::Compute,
842842
0u,
843843
returnValue));
844844
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
845-
846-
commandList->partitionCount = 2;
845+
EXPECT_EQ(1u, commandList->partitionCount);
847846

848847
returnValue = commandList->reset();
849848
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
850-
851849
EXPECT_EQ(1u, commandList->partitionCount);
852850
}
853851

@@ -856,13 +854,21 @@ using MultiTileImmediateCommandListTest = Test<MultiTileCommandListFixture<true,
856854
HWTEST2_F(MultiTileImmediateCommandListTest, GivenMultiTileDeviceWhenCreatingImmediateCommandListThenExpectPartitionCountMatchTileCount, IsWithinXeGfxFamily) {
857855
EXPECT_EQ(2u, device->getNEODevice()->getDeviceBitfield().count());
858856
EXPECT_EQ(2u, commandList->partitionCount);
857+
858+
auto returnValue = commandList->reset();
859+
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
860+
EXPECT_EQ(2u, commandList->partitionCount);
859861
}
860862

861863
using MultiTileImmediateInternalCommandListTest = Test<MultiTileCommandListFixture<true, true>>;
862864

863865
HWTEST2_F(MultiTileImmediateInternalCommandListTest, GivenMultiTileDeviceWhenCreatingInternalImmediateCommandListThenExpectPartitionCountEqualOne, IsWithinXeGfxFamily) {
864866
EXPECT_EQ(2u, device->getNEODevice()->getDeviceBitfield().count());
865867
EXPECT_EQ(1u, commandList->partitionCount);
868+
869+
auto returnValue = commandList->reset();
870+
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
871+
EXPECT_EQ(1u, commandList->partitionCount);
866872
}
867873

868874
HWTEST_F(CommandListCreate, WhenReservingSpaceThenCommandsAddedToBatchBuffer) {

0 commit comments

Comments
 (0)