Skip to content

Commit 59da6c9

Browse files
authored
Test for parse_limit (#2751)
1 parent 689f985 commit 59da6c9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/core/pool.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,13 @@ end
4747
CUDA.used_memory()
4848
CUDA.cached_memory()
4949
end
50+
51+
@testset "parse_limit" begin
52+
@test CUDA.parse_limit("8000kB") == UInt(8000*1000)
53+
@test CUDA.parse_limit("8000MB") == UInt(8000*1000*1000)
54+
@test CUDA.parse_limit("8GB") == UInt(8*1000*1000*1000)
55+
56+
@test CUDA.parse_limit("8KiB") == UInt(8*1024)
57+
@test CUDA.parse_limit("8MiB") == UInt(8*1024*1024)
58+
@test CUDA.parse_limit("8GiB") == UInt(8*1024*1024*1024)
59+
end

0 commit comments

Comments
 (0)