@@ -258,14 +258,12 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
258
258
commandQueue.clearLastBcsPackets ();
259
259
}
260
260
261
- bool isGpuHangDetected{false };
262
-
263
261
if (kernelOperation->blitPropertiesContainer .size () > 0 ) {
264
262
const auto newTaskCount = bcsCsrForAuxTranslation->flushBcsTask (kernelOperation->blitPropertiesContainer , false , commandQueue.isProfilingEnabled (), commandQueue.getDevice ());
265
- if (newTaskCount) {
266
- commandQueue.updateBcsTaskCount (bcsCsrForAuxTranslation->getOsContext ().getEngineType (), * newTaskCount);
263
+ if (newTaskCount <= CompletionStamp::notReady ) {
264
+ commandQueue.updateBcsTaskCount (bcsCsrForAuxTranslation->getOsContext ().getEngineType (), newTaskCount);
267
265
} else {
268
- isGpuHangDetected = true ;
266
+ completionStamp. taskCount = newTaskCount ;
269
267
}
270
268
}
271
269
commandQueue.updateLatestSentEnqueueType (EnqueueProperties::Operation::GpuKernel);
@@ -277,11 +275,11 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
277
275
if (printfHandler) {
278
276
const auto waitStatus = commandQueue.waitUntilComplete (completionStamp.taskCount , {}, completionStamp.flushStamp , false );
279
277
if (waitStatus == WaitStatus::GpuHang) {
280
- isGpuHangDetected = true ;
278
+ completionStamp. taskCount = CompletionStamp::gpuHang ;
281
279
}
282
280
283
281
if (!printfHandler->printEnqueueOutput ()) {
284
- isGpuHangDetected = true ;
282
+ completionStamp. taskCount = CompletionStamp::gpuHang ;
285
283
}
286
284
}
287
285
@@ -290,14 +288,10 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
290
288
}
291
289
surfaces.clear ();
292
290
293
- if (isGpuHangDetected) {
294
- completionStamp.taskCount = CompletionStamp::gpuHang;
295
- }
296
-
297
291
return completionStamp;
298
292
}
299
293
300
- bool CommandWithoutKernel::dispatchBlitOperation () {
294
+ uint32_t CommandWithoutKernel::dispatchBlitOperation () {
301
295
auto bcsCsr = kernelOperation->bcsCsr ;
302
296
UNRECOVERABLE_IF (bcsCsr == nullptr );
303
297
@@ -314,14 +308,14 @@ bool CommandWithoutKernel::dispatchBlitOperation() {
314
308
}
315
309
316
310
const auto newTaskCount = bcsCsr->flushBcsTask (kernelOperation->blitPropertiesContainer , false , commandQueue.isProfilingEnabled (), commandQueue.getDevice ());
317
- if (! newTaskCount) {
318
- return false ;
311
+ if (newTaskCount > CompletionStamp::notReady ) {
312
+ return newTaskCount ;
319
313
}
320
314
321
- commandQueue.updateBcsTaskCount (bcsCsr->getOsContext ().getEngineType (), * newTaskCount);
315
+ commandQueue.updateBcsTaskCount (bcsCsr->getOsContext ().getEngineType (), newTaskCount);
322
316
commandQueue.setLastBcsPacket (bcsCsr->getOsContext ().getEngineType ());
323
317
324
- return true ;
318
+ return newTaskCount ;
325
319
}
326
320
327
321
CompletionStamp &CommandWithoutKernel::submit (uint32_t taskLevel, bool terminated) {
@@ -420,8 +414,9 @@ CompletionStamp &CommandWithoutKernel::submit(uint32_t taskLevel, bool terminate
420
414
}
421
415
422
416
if (kernelOperation->blitEnqueue ) {
423
- if (!dispatchBlitOperation ()) {
424
- completionStamp.taskCount = CompletionStamp::gpuHang;
417
+ auto taskCount = dispatchBlitOperation ();
418
+ if (taskCount > CompletionStamp::notReady) {
419
+ completionStamp.taskCount = taskCount;
425
420
}
426
421
}
427
422
0 commit comments