Skip to content

Commit bc6dcd7

Browse files
committed
Fix tests for 1.10
1 parent 3e743d6 commit bc6dcd7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/testsuite/caching_allocator.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
T = Float32
88
dims = (1, 2, 3)
99

10-
GPUArrays.AllocCache.@enable AT :cache begin
11-
x1 = AT(zeros(T, dims))
10+
x1 = GPUArrays.AllocCache.@enable AT :cache begin
11+
AT(zeros(T, dims))
1212
end
1313
@test sizeof(pdcache, device, :cache) == sizeof(Float32) * prod(dims)
1414
@test length(named_cache.free) == 1
@@ -20,13 +20,14 @@
2020

2121
# Second allocation does not allocate - cache stays the same in size.
2222

23-
GPUArrays.AllocCache.@enable AT :cache begin
23+
x2, x_free = GPUArrays.AllocCache.@enable AT :cache begin
2424
x2 = AT(zeros(T, dims))
2525

2626
# Does not go to cache.
2727
GPUArrays.AllocCache.@disable begin
2828
x_free = AT(zeros(T, dims))
2929
end
30+
x2, x_free
3031
end
3132
@test sizeof(pdcache, device, :cache) == sizeof(Float32) * prod(dims)
3233
@test length(named_cache.free[key]) == 1
@@ -39,8 +40,8 @@
3940

4041
T2 = Int32
4142
key2 = hash((T2, dims))
42-
GPUArrays.AllocCache.@enable AT :cache begin
43-
x3 = AT(zeros(T2, dims))
43+
x3 = GPUArrays.AllocCache.@enable AT :cache begin
44+
AT(zeros(T2, dims))
4445
end
4546
@test sizeof(pdcache, device, :cache) == (sizeof(Float32) + sizeof(Int32)) * prod(dims)
4647

0 commit comments

Comments
 (0)