Skip to content

Commit ec6b333

Browse files
committed
Update
1 parent 29c6d35 commit ec6b333

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

test/dispatch.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function dispatch_tests(::Type{T}) where {T}
1515
c = one(T)
1616
x = convert.(T, [1, 2, 3])
1717
# Need to allocate 1 BigInt for the result and one for the buffer
18-
nalloc = 2 * (sizeof(Int) + _big_int_alloc())
18+
nalloc = 3 * _big_int_alloc()
1919
alloc_test(() -> MA.fused_map_reduce(MA.add_mul, x, x), nalloc)
2020
alloc_test(() -> MA.fused_map_reduce(MA.add_dot, x, x), nalloc)
2121
if T <: MA.AbstractMutable

test/utilities.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ include("dummy.jl")
1010
# v1.12.5 off by 8
1111
_big_int_alloc() = @allocated(BigInt(1))
1212

13-
function alloc_test(f, n)
13+
function alloc_test(f, expected_upper_bound)
1414
f() # compile
15-
y = @allocated f()
16-
@test y <= n
15+
measured_allocations = @allocated f()
16+
@test measured_allocations <= expected_upper_bound
1717
return
1818
end

0 commit comments

Comments
 (0)