Skip to content

Commit 6beddb8

Browse files
committed
Test for printing OutOfGPUMemoryError
1 parent 160f941 commit 6beddb8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/core/pool.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ CUDA.pool_alloc(0)
22

33
@test_throws OutOfGPUMemoryError CuArray{Int}(undef, 10^20)
44

5+
try
6+
CuArray{Int}(undef, 10^20)
7+
catch e
8+
@test startswith(sprint(showerror, e), "Out of GPU memory trying to allocate ")
9+
end
10+
11+
512
@testset "@allocated" begin
613
@test (CUDA.@allocated CuArray{Int32}(undef,1)) == 4
714
end

0 commit comments

Comments
 (0)