Skip to content

Commit 3c9c87a

Browse files
committed
Simplify.
1 parent 804a4b5 commit 3c9c87a

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

src/compiler/execution.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,10 @@ end
301301
foreach(free, argument_buffers)
302302

303303
# Check for errors
304-
Core.println(buf.status)
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.
305306
if buf.status == MTL.MTLCommandBufferStatusError
306-
err = buf.error
307-
if err !== nothing
308-
code = err.code # MTLCommandBufferError enum value
309-
description = err.localizedDescription
310-
311-
@error "GPU kernel execution failed" exception = (err, catch_backtrace()) kernel = nameof(kernel.f) error_code = code description = description
312-
end
307+
Core.println("ERROR: Failed to submit command buffer: $(buf.error.localizedDescription)")
313308
end
314309

315310
end

test/execution.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,3 @@ end
260260
@test Array(a)[] == 1
261261
end
262262
end
263-
264-
265-
@testset "error handling" begin
266-
function failing_kernel(arr, ptr)
267-
x = unsafe_load(reinterpret(Ptr{Int}, ptr))
268-
@inbounds arr[1] = x
269-
return nothing
270-
end
271-
272-
@test_logs (:error, r"GPU kernel execution failed") @metal failing_kernel(mtl([0], 0))
273-
end

0 commit comments

Comments
 (0)