We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72874f8 commit 3bcdff4Copy full SHA for 3bcdff4
1 file changed
src/cu.jl
@@ -71,11 +71,22 @@ end
71
72
function Dagger.execute!(proc::CuArrayDeviceProc, func, args...)
73
tls = Dagger.get_tls()
74
- fetch(Threads.@spawn begin
+ task = Threads.@spawn begin
75
Dagger.set_tls!(tls)
76
CUDA.device!(proc.device)
77
CUDA.@sync func(args...)
78
- end)
+ end
79
+ try
80
+ fetch(task)
81
+ catch err
82
+ @static if VERSION >= v"1.1"
83
+ stk = Base.catch_stack(task)
84
+ err, frames = stk[1]
85
+ rethrow(CapturedException(err, frames))
86
+ else
87
+ rethrow(task.result)
88
89
90
end
91
Base.show(io::IO, proc::CuArrayDeviceProc) =
92
print(io, "CuArrayDeviceProc on worker $(proc.owner), device $(proc.device), uuid $(proc.device_uuid)")
0 commit comments