Skip to content

Commit

Permalink
Fix tests for 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
pxl-th authored and maleadt committed Jan 8, 2025
1 parent 01c4e71 commit ee377ea
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/testsuite/caching_allocator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
T = Float32
dims = (1, 2, 3)

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

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

GPUArrays.AllocCache.@enable AT :cache begin
x2, x_free = GPUArrays.AllocCache.@enable AT :cache begin
x2 = AT(zeros(T, dims))

# Does not go to cache.
GPUArrays.AllocCache.@disable begin
x_free = AT(zeros(T, dims))
end
x2, x_free
end
@test sizeof(pdcache, device, :cache) == sizeof(Float32) * prod(dims)
@test length(named_cache.free[key]) == 1
Expand All @@ -39,8 +40,8 @@

T2 = Int32
key2 = hash((T2, dims))
GPUArrays.AllocCache.@enable AT :cache begin
x3 = AT(zeros(T2, dims))
x3 = GPUArrays.AllocCache.@enable AT :cache begin
AT(zeros(T2, dims))
end
@test sizeof(pdcache, device, :cache) == (sizeof(Float32) + sizeof(Int32)) * prod(dims)

Expand Down

0 comments on commit ee377ea

Please sign in to comment.