Skip to content

Commit a047a11

Browse files
committed
Format and fix test.
1 parent 2c719ef commit a047a11

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/compiler/execution.jl

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

303303
# Check for errors
304+
Core.println(buf.status)
304305
if buf.status == MTL.MTLCommandBufferStatusError
305306
err = buf.error
306307
if err !== nothing
307308
code = err.code # MTLCommandBufferError enum value
308309
description = err.localizedDescription
309310

310-
@error "GPU kernel execution failed" exception = (err, catch_backtrace()) kernel = nameof(kernel.f) error_code = code description = description
311+
@error "GPU kernel execution failed" exception = (err, catch_backtrace()) kernel = nameof(kernel.f) error_code = code description = description
311312
end
312313
end
314+
313315
end
314316

315317
commit!(cmdbuf)

test/execution.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,11 @@ end
262262
end
263263

264264
@testset "error handling" begin
265-
function failing_kernel()
266-
x = unsafe_load(Ptr{Int}(0))
265+
function failing_kernel(arr, ptr)
266+
x = unsafe_load(reinterpret(Ptr{Int}, ptr))
267+
@inbounds arr[1] = x
267268
return nothing
268269
end
269270

270-
@test_logs (:error, r"GPU kernel execution failed") @metal failing_kernel()
271+
@test_logs (:error, r"GPU kernel execution failed") @metal failing_kernel(mtl([0], 0)
271272
end

0 commit comments

Comments
 (0)