Skip to content

Commit ca092c8

Browse files
vovwmaleadt
andauthored
Add error reporting to command buffer completion handler (#521)
Co-authored-by: Tim Besard <[email protected]>
1 parent 1b811cb commit ca092c8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/compiler/execution.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,14 @@ end
300300
empty!(roots)
301301
foreach(free, argument_buffers)
302302

303-
# TODO: access logs here to check for errors
304-
# https://developer.apple.com/videos/play/wwdc2020/10616/
305-
end
303+
# Check for errors
304+
# XXX: we cannot do this nicely, e.g. throwing an `error` or reporting with `@error`
305+
# because we're not allowed to switch tasks from this contexts.
306+
if buf.status == MTL.MTLCommandBufferStatusError
307+
Core.println("ERROR: Failed to submit command buffer: $(buf.error.localizedDescription)")
308+
end
306309

310+
end
307311
commit!(cmdbuf)
308312
end
309313

0 commit comments

Comments
 (0)