@@ -35,35 +35,31 @@ void EncodeDispatchKernel<Family>::adjustInterfaceDescriptorData(INTERFACE_DESCR
3535 const auto &hwInfoConfig = *HwInfoConfig::get (hwInfo.platform .eProductFamily );
3636
3737 if (hwInfoConfig.isDisableOverdispatchAvailable (hwInfo)) {
38- interfaceDescriptor.setThreadGroupDispatchSize (INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_1);
39-
40- if (hwInfo.gtSystemInfo .MaxDualSubSlicesSupported == hwInfo.gtSystemInfo .DualSubSliceCount ) {
41- UNRECOVERABLE_IF (numGrf == 0u );
42-
43- constexpr uint32_t maxThreadsInTGForTGDispatchSize8 = 16u ;
44- constexpr uint32_t maxThreadsInTGForTGDispatchSize4 = 32u ;
45- auto &hwHelper = HwHelper::get (hwInfo.platform .eRenderCoreFamily );
46- uint32_t availableThreadCount = hwHelper.calculateAvailableThreadCount (hwInfo, numGrf);
47- uint32_t numberOfThreadsInThreadGroup = interfaceDescriptor.getNumberOfThreadsInGpgpuThreadGroup ();
48- uint32_t dispatchedTotalThreadCount = numberOfThreadsInThreadGroup * threadGroupCount;
49-
50- UNRECOVERABLE_IF (numberOfThreadsInThreadGroup == 0u );
51-
52- if (dispatchedTotalThreadCount <= availableThreadCount) {
53- interfaceDescriptor.setThreadGroupDispatchSize (INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_1);
54- } else if (numberOfThreadsInThreadGroup <= maxThreadsInTGForTGDispatchSize8) {
55- interfaceDescriptor.setThreadGroupDispatchSize (INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_8);
56- } else if (numberOfThreadsInThreadGroup <= maxThreadsInTGForTGDispatchSize4) {
57- interfaceDescriptor.setThreadGroupDispatchSize (INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_4);
58- } else {
59- interfaceDescriptor.setThreadGroupDispatchSize (INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_2);
60- }
61-
62- uint32_t exponent = INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_1 - interfaceDescriptor.getThreadGroupDispatchSize ();
63- uint32_t threadGroupDispatchSize = 1u << exponent;
64- if ((dispatchedTotalThreadCount % (numberOfThreadsInThreadGroup * threadGroupDispatchSize)) != 0 ) {
65- interfaceDescriptor.setThreadGroupDispatchSize (INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_1);
66- }
38+ UNRECOVERABLE_IF (numGrf == 0u );
39+
40+ constexpr uint32_t maxThreadsInTGForTGDispatchSize8 = 16u ;
41+ constexpr uint32_t maxThreadsInTGForTGDispatchSize4 = 32u ;
42+ auto &hwHelper = HwHelper::get (hwInfo.platform .eRenderCoreFamily );
43+ uint32_t availableThreadCount = hwHelper.calculateAvailableThreadCount (hwInfo, numGrf);
44+ uint32_t numberOfThreadsInThreadGroup = interfaceDescriptor.getNumberOfThreadsInGpgpuThreadGroup ();
45+ uint32_t dispatchedTotalThreadCount = numberOfThreadsInThreadGroup * threadGroupCount;
46+
47+ UNRECOVERABLE_IF (numberOfThreadsInThreadGroup == 0u );
48+
49+ if (dispatchedTotalThreadCount <= availableThreadCount) {
50+ interfaceDescriptor.setThreadGroupDispatchSize (INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_1);
51+ } else if (numberOfThreadsInThreadGroup <= maxThreadsInTGForTGDispatchSize8) {
52+ interfaceDescriptor.setThreadGroupDispatchSize (INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_8);
53+ } else if (numberOfThreadsInThreadGroup <= maxThreadsInTGForTGDispatchSize4) {
54+ interfaceDescriptor.setThreadGroupDispatchSize (INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_4);
55+ } else {
56+ interfaceDescriptor.setThreadGroupDispatchSize (INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_2);
57+ }
58+
59+ uint32_t exponent = INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_1 - interfaceDescriptor.getThreadGroupDispatchSize ();
60+ uint32_t threadGroupDispatchSize = 1u << exponent;
61+ if ((dispatchedTotalThreadCount % (numberOfThreadsInThreadGroup * threadGroupDispatchSize)) != 0 ) {
62+ interfaceDescriptor.setThreadGroupDispatchSize (INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_1);
6763 }
6864 }
6965
0 commit comments