Skip to content
This repository was archived by the owner on Mar 12, 2021. It is now read-only.

Commit dd4cc1e

Browse files
committed
Fix exception check.
1 parent 5cb8c15 commit dd4cc1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/memory.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ function actual_alloc(bytes)::Union{Nothing,CuPtr{Nothing}}
6868
@assert !haskey(allocated, ptr)
6969
allocated[ptr] = buf
7070
return ptr
71-
catch ex
72-
ex.code == CUDAdrv.ERROR_OUT_OF_MEMORY || rethrow()
71+
catch err
72+
(isa(err, CuError) && err.code == CUDAdrv.ERROR_OUT_OF_MEMORY) || rethrow()
7373
end
7474

7575
return nothing

0 commit comments

Comments
 (0)