mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 09:58:55 +08:00
Revert "Use cached group sizes in zeKernelSetGroupSize"
This reverts commit 7ec94c6aaa.
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d793f37dd8
commit
2e2abf1b6e
@@ -271,12 +271,6 @@ ze_result_t KernelImp::setGroupSize(uint32_t groupSizeX, uint32_t groupSizeY,
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (this->groupSize[0] == groupSizeX &&
|
||||
this->groupSize[1] == groupSizeY &&
|
||||
this->groupSize[2] == groupSizeZ) {
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
auto numChannels = kernelImmData->getDescriptor().kernelAttributes.numLocalIdChannels;
|
||||
Vec3<size_t> groupSize{groupSizeX, groupSizeY, groupSizeZ};
|
||||
auto itemsInGroup = Math::computeTotalElementsCount(groupSize);
|
||||
|
||||
@@ -136,18 +136,6 @@ struct MockKernelWithCallTracking : Mock<::L0::Kernel> {
|
||||
return KernelImp::setArgBufferWithAlloc(argIndex, argVal, allocation);
|
||||
}
|
||||
size_t setArgBufferWithAllocCalled = 0u;
|
||||
|
||||
ze_result_t setGroupSize(uint32_t groupSizeX, uint32_t groupSizeY, uint32_t groupSizeZ) override {
|
||||
if (this->groupSize[0] == groupSizeX &&
|
||||
this->groupSize[1] == groupSizeY &&
|
||||
this->groupSize[2] == groupSizeZ) {
|
||||
setGroupSizeSkipCount++;
|
||||
} else {
|
||||
setGroupSizeSkipCount = 0u;
|
||||
}
|
||||
return KernelImp::setGroupSize(groupSizeX, groupSizeY, groupSizeZ);
|
||||
}
|
||||
size_t setGroupSizeSkipCount = 0u;
|
||||
};
|
||||
|
||||
using SetKernelArgCacheTest = Test<ModuleFixture>;
|
||||
@@ -324,44 +312,6 @@ TEST_F(KernelImpSetGroupSizeTest, givenZeroGroupSizeWhenSettingGroupSizeThenInva
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, ret);
|
||||
}
|
||||
|
||||
TEST_F(KernelImpSetGroupSizeTest, givenValidGroupSizeWhenSetMultipleTimesThenSetGroupSizeIsOnlyExecutedIfNeeded) {
|
||||
MockKernelWithCallTracking mockKernel;
|
||||
Mock<Module> mockModule(this->device, nullptr);
|
||||
mockKernel.module = &mockModule;
|
||||
|
||||
// First call with {2u, 3u, 5u} group size - don't skip setGroupSize execution
|
||||
auto ret = mockKernel.setGroupSize(2u, 3u, 5u);
|
||||
EXPECT_EQ(2u, mockKernel.groupSize[0]);
|
||||
EXPECT_EQ(3u, mockKernel.groupSize[1]);
|
||||
EXPECT_EQ(5u, mockKernel.groupSize[2]);
|
||||
EXPECT_EQ(0u, mockKernel.setGroupSizeSkipCount);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
|
||||
|
||||
// Second call with {2u, 3u, 5u} group size - skip setGroupSize execution
|
||||
ret = mockKernel.setGroupSize(2u, 3u, 5u);
|
||||
EXPECT_EQ(2u, mockKernel.groupSize[0]);
|
||||
EXPECT_EQ(3u, mockKernel.groupSize[1]);
|
||||
EXPECT_EQ(5u, mockKernel.groupSize[2]);
|
||||
EXPECT_EQ(1u, mockKernel.setGroupSizeSkipCount);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
|
||||
|
||||
// First call with {1u, 2u, 3u} group size - don't skip setGroupSize execution
|
||||
ret = mockKernel.setGroupSize(1u, 2u, 3u);
|
||||
EXPECT_EQ(1u, mockKernel.groupSize[0]);
|
||||
EXPECT_EQ(2u, mockKernel.groupSize[1]);
|
||||
EXPECT_EQ(3u, mockKernel.groupSize[2]);
|
||||
EXPECT_EQ(0u, mockKernel.setGroupSizeSkipCount);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
|
||||
|
||||
// Second call with {1u, 2u, 3u} group size - skip setGroupSize execution
|
||||
ret = mockKernel.setGroupSize(1u, 2u, 3u);
|
||||
EXPECT_EQ(1u, mockKernel.groupSize[0]);
|
||||
EXPECT_EQ(2u, mockKernel.groupSize[1]);
|
||||
EXPECT_EQ(3u, mockKernel.groupSize[2]);
|
||||
EXPECT_EQ(1u, mockKernel.setGroupSizeSkipCount);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
|
||||
}
|
||||
|
||||
using SetKernelArg = Test<ModuleFixture>;
|
||||
using ImageSupport = IsWithinProducts<IGFX_SKYLAKE, IGFX_TIGERLAKE_LP>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user