File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
offload/plugins-nextgen/common/include Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1360,7 +1360,10 @@ struct KernelRunRecordTy {
1360
1360
1361
1361
if (IdxCUMulti >= CUMultiplierCandidate.size ()) {
1362
1362
// No more element to search.
1363
+ // Max run counter to stop further runs.
1363
1364
// Return current optimal launch parameters.
1365
+ TuningData[KernelName].RunCounters = RunLimiter + 1 ;
1366
+
1364
1367
return {TuningData[KernelName].MinEntry .NumTeams ,
1365
1368
TuningData[KernelName].MinEntry .NumThreads };
1366
1369
}
@@ -1374,7 +1377,11 @@ struct KernelRunRecordTy {
1374
1377
IdxThread++;
1375
1378
TuningData[KernelName].IdxThread = IdxThread;
1376
1379
1377
- if (IdxThread >= ThreadCandidate.size ()) {
1380
+ uint16_t ConstWGSize = GenericDevice.getDefaultNumThreads ();
1381
+
1382
+ // Threads should be smaller than ConstWGSize.
1383
+ if (IdxThread >= ThreadCandidate.size () ||
1384
+ ThreadCandidate[IdxThread] >= ConstWGSize) {
1378
1385
TuningData[KernelName].IdxThread = 0 ;
1379
1386
TuningData[KernelName].IdxCUMultiplier ++;
1380
1387
}
You can’t perform that action at this time.
0 commit comments