refactor: unify calculating max group size between OCL and L0

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-02-27 12:03:03 +00:00
committed by Compute-Runtime-Automation
parent 0bf8e8727e
commit 373ef608bc
2 changed files with 3 additions and 6 deletions

View File

@@ -2203,13 +2203,10 @@ bool Kernel::areMultipleSubDevicesInContext() const {
void Kernel::reconfigureKernel() {
const auto &kernelDescriptor = kernelInfo.kernelDescriptor;
if (kernelDescriptor.kernelAttributes.numGrfRequired == GrfConfig::largeGrfNumber &&
kernelDescriptor.kernelAttributes.simdSize != 32) {
this->maxKernelWorkGroupSize >>= 1;
}
const auto &gfxCoreHelper = this->getGfxCoreHelper();
auto maxWorkGroupSize = gfxCoreHelper.calculateMaxWorkGroupSize(kernelDescriptor, this->maxKernelWorkGroupSize);
bool isLocalIdsGeneratedByHw = false; // if local ids generated by runtime then more work groups available
auto maxWorkGroupSize = static_cast<uint32_t>(kernelInfo.getMaxRequiredWorkGroupSize(getMaxKernelWorkGroupSize()));
maxWorkGroupSize = static_cast<uint32_t>(kernelInfo.getMaxRequiredWorkGroupSize(maxWorkGroupSize));
this->maxKernelWorkGroupSize = gfxCoreHelper.adjustMaxWorkGroupSize(kernelDescriptor.kernelAttributes.numGrfRequired, kernelDescriptor.kernelAttributes.simdSize, isLocalIdsGeneratedByHw, maxWorkGroupSize);

View File

@@ -3287,7 +3287,7 @@ struct KernelLargeGrfTests : Test<ClDeviceFixture> {
SPatchExecutionEnvironment executionEnvironment = {};
};
HWTEST_F(KernelLargeGrfTests, GivenLargeGrfAndSimdSizeWhenGettingMaxWorkGroupSizeThenCorrectValueReturned) {
HWTEST2_F(KernelLargeGrfTests, GivenLargeGrfAndSimdSizeWhenGettingMaxWorkGroupSizeThenCorrectValueReturned, IsAtLeastXeHpCore) {
pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 16;
pKernelInfo->kernelDescriptor.kernelAttributes.crossThreadDataSize = 4;
pKernelInfo->kernelDescriptor.payloadMappings.implicitArgs.maxWorkGroupSize = 0;