Skip to content

Commit 5091e31

Browse files
committed
Update tolerance for allocations tests
1 parent b716f07 commit 5091e31

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed

test/test_alloc.jl

+54-54
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function test_alloc()
3131
expected_symmlq_bytes = storage_symmlq_bytes(n)
3232
symmlq(L, b) # warmup
3333
actual_symmlq_bytes = @allocated symmlq(L, b)
34-
@test actual_symmlq_bytes 1.1 * expected_symmlq_bytes
34+
@test actual_symmlq_bytes 1.02 * expected_symmlq_bytes
3535

3636
solver = SymmlqSolver(L, b)
3737
symmlq!(solver, L, b) # warmup
@@ -46,7 +46,7 @@ function test_alloc()
4646
expected_cg_bytes = storage_cg_bytes(n)
4747
cg(L, b) # warmup
4848
actual_cg_bytes = @allocated cg(L, b)
49-
@test actual_cg_bytes 1.1 * expected_cg_bytes
49+
@test actual_cg_bytes 1.02 * expected_cg_bytes
5050

5151
solver = CgSolver(L, b)
5252
cg!(solver, L, b) # warmup
@@ -61,7 +61,7 @@ function test_alloc()
6161
expected_minres_bytes = storage_minres_bytes(n)
6262
minres(L, b) # warmup
6363
actual_minres_bytes = @allocated minres(L, b)
64-
@test actual_minres_bytes 1.1 * expected_minres_bytes
64+
@test actual_minres_bytes 1.02 * expected_minres_bytes
6565

6666
solver = MinresSolver(L, b)
6767
minres!(solver, L, b) # warmup
@@ -78,13 +78,13 @@ function test_alloc()
7878
storage_diom_bytes(mem, n) = 8 * storage_diom(mem, n)
7979

8080
expected_diom_bytes = storage_diom_bytes(mem, n)
81-
diom(A, b, memory=mem) # warmup
82-
actual_diom_bytes = @allocated diom(A, b, memory=mem)
83-
@test actual_diom_bytes 1.05 * expected_diom_bytes
81+
diom(L, b, memory=mem) # warmup
82+
actual_diom_bytes = @allocated diom(L, b, memory=mem)
83+
@test actual_diom_bytes 1.02 * expected_diom_bytes
8484

85-
solver = DiomSolver(A, b)
86-
diom!(solver, A, b) # warmup
87-
inplace_diom_bytes = @allocated diom!(solver, A, b)
85+
solver = DiomSolver(L, b)
86+
diom!(solver, L, b) # warmup
87+
inplace_diom_bytes = @allocated diom!(solver, L, b)
8888
@test (VERSION < v"1.5") || (inplace_diom_bytes 240)
8989

9090
# CG_LANCZOS needs:
@@ -93,13 +93,13 @@ function test_alloc()
9393
storage_cg_lanczos_bytes(n) = 8 * storage_cg_lanczos(n)
9494

9595
expected_cg_lanczos_bytes = storage_cg_lanczos_bytes(n)
96-
cg_lanczos(A, b) # warmup
97-
actual_cg_lanczos_bytes = @allocated cg_lanczos(A, b)
98-
@test actual_cg_lanczos_bytes 1.1 * expected_cg_lanczos_bytes
96+
cg_lanczos(L, b) # warmup
97+
actual_cg_lanczos_bytes = @allocated cg_lanczos(L, b)
98+
@test actual_cg_lanczos_bytes 1.02 * expected_cg_lanczos_bytes
9999

100-
solver = CgLanczosSolver(A, b)
101-
cg_lanczos!(solver, A, b) # warmup
102-
inplace_cg_lanczos_bytes = @allocated cg_lanczos!(solver, A, b)
100+
solver = CgLanczosSolver(L, b)
101+
cg_lanczos!(solver, L, b) # warmup
102+
inplace_cg_lanczos_bytes = @allocated cg_lanczos!(solver, L, b)
103103
@test (VERSION < v"1.5") || (inplace_cg_lanczos_bytes == 144)
104104

105105
# CG_LANCZOS_SHIFT_SEQ needs:
@@ -111,13 +111,13 @@ function test_alloc()
111111
storage_cg_lanczos_shift_seq_bytes(n, nshifts) = 8 * storage_cg_lanczos_shift_seq(n, nshifts)
112112

113113
expected_cg_lanczos_shift_seq_bytes = storage_cg_lanczos_shift_seq_bytes(n, nshifts)
114-
cg_lanczos_shift_seq(A, b, shifts) # warmup
115-
actual_cg_lanczos_shift_seq_bytes = @allocated cg_lanczos_shift_seq(A, b, shifts)
116-
@test actual_cg_lanczos_shift_seq_bytes 1.1 * expected_cg_lanczos_shift_seq_bytes
114+
cg_lanczos_shift_seq(L, b, shifts) # warmup
115+
actual_cg_lanczos_shift_seq_bytes = @allocated cg_lanczos_shift_seq(L, b, shifts)
116+
@test actual_cg_lanczos_shift_seq_bytes 1.02 * expected_cg_lanczos_shift_seq_bytes
117117

118-
solver = CgLanczosShiftSolver(A, b, shifts)
119-
cg_lanczos_shift_seq!(solver, A, b, shifts) # warmup
120-
inplace_cg_lanczos_shift_seq_bytes = @allocated cg_lanczos_shift_seq!(solver, A, b, shifts)
118+
solver = CgLanczosShiftSolver(L, b, shifts)
119+
cg_lanczos_shift_seq!(solver, L, b, shifts) # warmup
120+
inplace_cg_lanczos_shift_seq_bytes = @allocated cg_lanczos_shift_seq!(solver, L, b, shifts)
121121
@test (VERSION < v"1.5") || (inplace_cg_lanczos_shift_seq_bytes 356)
122122

123123
# DQGMRES needs:
@@ -129,13 +129,13 @@ function test_alloc()
129129
storage_dqgmres_bytes(mem, n) = 8 * storage_dqgmres(mem, n)
130130

131131
expected_dqgmres_bytes = storage_dqgmres_bytes(mem, n)
132-
dqgmres(A, b, memory=mem) # warmup
133-
actual_dqgmres_bytes = @allocated dqgmres(A, b, memory=mem)
134-
@test actual_dqgmres_bytes 1.05 * expected_dqgmres_bytes
132+
dqgmres(L, b, memory=mem) # warmup
133+
actual_dqgmres_bytes = @allocated dqgmres(L, b, memory=mem)
134+
@test actual_dqgmres_bytes 1.02 * expected_dqgmres_bytes
135135

136-
solver = DqgmresSolver(A, b)
137-
dqgmres!(solver, A, b) # warmup
138-
inplace_dqgmres_bytes = @allocated dqgmres!(solver, A, b)
136+
solver = DqgmresSolver(L, b)
137+
dqgmres!(solver, L, b) # warmup
138+
inplace_dqgmres_bytes = @allocated dqgmres!(solver, L, b)
139139
@test (VERSION < v"1.5") || (inplace_dqgmres_bytes == 208)
140140

141141
# CR needs:
@@ -146,7 +146,7 @@ function test_alloc()
146146
expected_cr_bytes = storage_cr_bytes(n)
147147
cr(L, b, rtol=1e-6) # warmup
148148
actual_cr_bytes = @allocated cr(L, b, rtol=1e-6)
149-
@test actual_cr_bytes 1.1 * expected_cr_bytes
149+
@test actual_cr_bytes 1.02 * expected_cr_bytes
150150

151151
solver = CrSolver(L, b)
152152
cr!(solver, L, b, rtol=1e-6) # warmup
@@ -162,7 +162,7 @@ function test_alloc()
162162
expected_crmr_bytes = storage_crmr_bytes(n, m)
163163
(x, stats) = crmr(Au, c) # warmup
164164
actual_crmr_bytes = @allocated crmr(Au, c)
165-
@test actual_crmr_bytes 1.1 * expected_crmr_bytes
165+
@test actual_crmr_bytes 1.02 * expected_crmr_bytes
166166

167167
solver = CrmrSolver(Au, c)
168168
crmr!(solver, Au, c) # warmup
@@ -176,7 +176,7 @@ function test_alloc()
176176
expected_cgs_bytes = storage_cgs_bytes(n)
177177
cgs(A, b) # warmup
178178
actual_cgs_bytes = @allocated cgs(A, b)
179-
@test actual_cgs_bytes 1.1 * expected_cgs_bytes
179+
@test actual_cgs_bytes 1.02 * expected_cgs_bytes
180180

181181
solver = CgsSolver(A, b)
182182
cgs!(solver, A, b) # warmup
@@ -190,7 +190,7 @@ function test_alloc()
190190
expected_bicgstab_bytes = storage_bicgstab_bytes(n)
191191
bicgstab(A, b) # warmup
192192
actual_bicgstab_bytes = @allocated bicgstab(A, b)
193-
@test actual_bicgstab_bytes 1.1 * expected_bicgstab_bytes
193+
@test actual_bicgstab_bytes 1.02 * expected_bicgstab_bytes
194194

195195
solver = BicgstabSolver(A, b)
196196
bicgstab!(solver, A, b) # warmup
@@ -206,7 +206,7 @@ function test_alloc()
206206
expected_craigmr_bytes = storage_craigmr_bytes(n, m)
207207
craigmr(Au, c) # warmup
208208
actual_craigmr_bytes = @allocated craigmr(Au, c)
209-
@test actual_craigmr_bytes 1.1 * expected_craigmr_bytes
209+
@test actual_craigmr_bytes 1.02 * expected_craigmr_bytes
210210

211211
solver = CraigmrSolver(Au, c)
212212
craigmr!(solver, Au, c) # warmup
@@ -222,7 +222,7 @@ function test_alloc()
222222
expected_cgne_bytes = storage_cgne_bytes(n, m)
223223
(x, stats) = cgne(Au, c) # warmup
224224
actual_cgne_bytes = @allocated cgne(Au, c)
225-
@test actual_cgne_bytes 1.1 * expected_cgne_bytes
225+
@test actual_cgne_bytes 1.02 * expected_cgne_bytes
226226

227227
solver = CgneSolver(Au, c)
228228
cgne!(solver, Au, c) # warmup
@@ -238,7 +238,7 @@ function test_alloc()
238238
expected_lnlq_bytes = storage_lnlq_bytes(n, m)
239239
lnlq(Au, c) # warmup
240240
actual_lnlq_bytes = @allocated lnlq(Au, c)
241-
@test actual_lnlq_bytes 1.1 * expected_lnlq_bytes
241+
@test actual_lnlq_bytes 1.02 * expected_lnlq_bytes
242242

243243
solver = LnlqSolver(Au, c)
244244
lnlq!(solver, Au, c) # warmup
@@ -254,7 +254,7 @@ function test_alloc()
254254
expected_craig_bytes = storage_craig_bytes(n, m)
255255
craig(Au, c) # warmup
256256
actual_craig_bytes = @allocated craig(Au, c)
257-
@test actual_craig_bytes 1.1 * expected_craig_bytes
257+
@test actual_craig_bytes 1.02 * expected_craig_bytes
258258

259259
solver = CraigSolver(Au, c)
260260
craig!(solver, Au, c) # warmup
@@ -270,7 +270,7 @@ function test_alloc()
270270
expected_lslq_bytes = storage_lslq_bytes(n, m)
271271
(x, stats) = lslq(Ao, b) # warmup
272272
actual_lslq_bytes = @allocated lslq(Ao, b)
273-
@test actual_lslq_bytes 1.1 * expected_lslq_bytes
273+
@test actual_lslq_bytes 1.02 * expected_lslq_bytes
274274

275275
solver = LslqSolver(Ao, b)
276276
lslq!(solver, Ao, b) # warmup
@@ -286,7 +286,7 @@ function test_alloc()
286286
expected_cgls_bytes = storage_cgls_bytes(n, m)
287287
(x, stats) = cgls(Ao, b) # warmup
288288
actual_cgls_bytes = @allocated cgls(Ao, b)
289-
@test actual_cgls_bytes 1.1 * expected_cgls_bytes
289+
@test actual_cgls_bytes 1.02 * expected_cgls_bytes
290290

291291
solver = CglsSolver(Ao, b)
292292
cgls!(solver, Ao, b) # warmup
@@ -302,7 +302,7 @@ function test_alloc()
302302
expected_lsqr_bytes = storage_lsqr_bytes(n, m)
303303
(x, stats) = lsqr(Ao, b) # warmup
304304
actual_lsqr_bytes = @allocated lsqr(Ao, b)
305-
@test actual_lsqr_bytes 1.1 * expected_lsqr_bytes
305+
@test actual_lsqr_bytes 1.02 * expected_lsqr_bytes
306306

307307
solver = LsqrSolver(Ao, b)
308308
lsqr!(solver, Ao, b) # warmup
@@ -318,7 +318,7 @@ function test_alloc()
318318
expected_crls_bytes = storage_crls_bytes(n, m)
319319
(x, stats) = crls(Ao, b) # warmup
320320
actual_crls_bytes = @allocated crls(Ao, b)
321-
@test actual_crls_bytes 1.1 * expected_crls_bytes
321+
@test actual_crls_bytes 1.02 * expected_crls_bytes
322322

323323
solver = CrlsSolver(Ao, b)
324324
crls!(solver, Ao, b) # warmup
@@ -334,7 +334,7 @@ function test_alloc()
334334
expected_lsmr_bytes = storage_lsmr_bytes(n, m)
335335
(x, stats) = lsmr(Ao, b) # warmup
336336
actual_lsmr_bytes = @allocated lsmr(Ao, b)
337-
@test actual_lsmr_bytes 1.1 * expected_lsmr_bytes
337+
@test actual_lsmr_bytes 1.02 * expected_lsmr_bytes
338338

339339
solver = LsmrSolver(Ao, b)
340340
lsmr!(solver, Ao, b) # warmup
@@ -350,7 +350,7 @@ function test_alloc()
350350
expected_usymqr_bytes = storage_usymqr_bytes(n, m)
351351
(x, stats) = usymqr(Lo, b, c) # warmup
352352
actual_usymqr_bytes = @allocated usymqr(Lo, b, c)
353-
@test actual_usymqr_bytes 1.1 * expected_usymqr_bytes
353+
@test actual_usymqr_bytes 1.02 * expected_usymqr_bytes
354354

355355
solver = UsymqrSolver(Lo, b)
356356
usymqr!(solver, Lo, b, c) # warmup
@@ -366,7 +366,7 @@ function test_alloc()
366366
expected_trilqr_bytes = storage_trilqr_bytes(n, n)
367367
trilqr(L, b, b) # warmup
368368
actual_trilqr_bytes = @allocated trilqr(L, b, b)
369-
@test actual_trilqr_bytes 1.1 * expected_trilqr_bytes
369+
@test actual_trilqr_bytes 1.02 * expected_trilqr_bytes
370370

371371
solver = TrilqrSolver(L, b)
372372
trilqr!(solver, L, b, b) # warmup
@@ -381,7 +381,7 @@ function test_alloc()
381381
expected_bilq_bytes = storage_bilq_bytes(n)
382382
bilq(L, b) # warmup
383383
actual_bilq_bytes = @allocated bilq(L, b)
384-
@test actual_bilq_bytes 1.1 * expected_bilq_bytes
384+
@test actual_bilq_bytes 1.02 * expected_bilq_bytes
385385

386386
solver = BilqSolver(L, b)
387387
bilq!(solver, L, b) # warmup
@@ -396,7 +396,7 @@ function test_alloc()
396396
expected_bilqr_bytes = storage_bilqr_bytes(n)
397397
bilqr(L, b, b) # warmup
398398
actual_bilqr_bytes = @allocated bilqr(L, b, b)
399-
@test actual_bilqr_bytes 1.1 * expected_bilqr_bytes
399+
@test actual_bilqr_bytes 1.02 * expected_bilqr_bytes
400400

401401
solver = BilqrSolver(L, b)
402402
bilqr!(solver, L, b, b) # warmup
@@ -409,13 +409,13 @@ function test_alloc()
409409
storage_minres_qlp_bytes(n) = 8 * storage_minres_qlp(n)
410410

411411
expected_minres_qlp_bytes = storage_minres_qlp_bytes(n)
412-
minres_qlp(A, b) # warmup
413-
actual_minres_qlp_bytes = @allocated minres_qlp(A, b)
414-
@test actual_minres_qlp_bytes 1.1 * expected_minres_qlp_bytes
412+
minres_qlp(L, b) # warmup
413+
actual_minres_qlp_bytes = @allocated minres_qlp(L, b)
414+
@test actual_minres_qlp_bytes 1.02 * expected_minres_qlp_bytes
415415

416-
solver = MinresQlpSolver(A, b)
417-
minres_qlp!(solver, A, b) # warmup
418-
inplace_minres_qlp_bytes = @allocated minres_qlp!(solver, A, b)
416+
solver = MinresQlpSolver(L, b)
417+
minres_qlp!(solver, L, b) # warmup
418+
inplace_minres_qlp_bytes = @allocated minres_qlp!(solver, L, b)
419419
@test (VERSION < v"1.5") || (inplace_minres_qlp_bytes == 208)
420420

421421
# QMR needs:
@@ -426,7 +426,7 @@ function test_alloc()
426426
expected_qmr_bytes = storage_qmr_bytes(n)
427427
qmr(L, b) # warmup
428428
actual_qmr_bytes = @allocated qmr(L, b)
429-
@test actual_qmr_bytes 1.1 * expected_qmr_bytes
429+
@test actual_qmr_bytes 1.02 * expected_qmr_bytes
430430

431431
solver = QmrSolver(L, b)
432432
qmr!(solver, L, b) # warmup
@@ -442,7 +442,7 @@ function test_alloc()
442442
expected_usymlq_bytes = storage_usymlq_bytes(n, m)
443443
usymlq(Lu, c, b) # warmup
444444
actual_usymlq_bytes = @allocated usymlq(Lu, c, b)
445-
@test actual_usymlq_bytes 1.1 * expected_usymlq_bytes
445+
@test actual_usymlq_bytes 1.02 * expected_usymlq_bytes
446446

447447
solver = UsymlqSolver(Lu, c)
448448
usymlq!(solver, Lu, c, b) # warmup
@@ -458,7 +458,7 @@ function test_alloc()
458458
expected_tricg_bytes = storage_tricg_bytes(n, m)
459459
tricg(Lu, c, b) # warmup
460460
actual_tricg_bytes = @allocated tricg(Lu, c, b)
461-
@test actual_tricg_bytes 1.1 * expected_tricg_bytes
461+
@test actual_tricg_bytes 1.02 * expected_tricg_bytes
462462

463463
solver = TricgSolver(Lu, c)
464464
tricg!(solver, Lu, c, b) # warmup
@@ -474,7 +474,7 @@ function test_alloc()
474474
expected_trimr_bytes = storage_trimr_bytes(n, m)
475475
trimr(Lu, c, b) # warmup
476476
actual_trimr_bytes = @allocated trimr(Lu, c, b)
477-
@test actual_trimr_bytes 1.1 * expected_trimr_bytes
477+
@test actual_trimr_bytes 1.02 * expected_trimr_bytes
478478

479479
solver = TrimrSolver(Lu, c)
480480
trimr!(solver, Lu, c, b) # warmup

0 commit comments

Comments
 (0)