Skip to content

Commit 15104ad

Browse files
committed
Update tolerance for allocations tests
1 parent f777bfb commit 15104ad

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed

test/test_alloc.jl

Lines changed: 54 additions & 54 deletions
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
@@ -177,7 +177,7 @@ function test_alloc()
177177
expected_cgs_bytes = storage_cgs_bytes(n)
178178
cgs(L, b) # warmup
179179
actual_cgs_bytes = @allocated cgs(L, b)
180-
@test actual_cgs_bytes 1.1 * expected_cgs_bytes
180+
@test actual_cgs_bytes 1.02 * expected_cgs_bytes
181181

182182
solver = CgsSolver(L, b)
183183
cgs!(solver, L, b) # warmup
@@ -192,7 +192,7 @@ function test_alloc()
192192
expected_bicgstab_bytes = storage_bicgstab_bytes(n)
193193
bicgstab(L, b) # warmup
194194
actual_bicgstab_bytes = @allocated bicgstab(L, b)
195-
@test actual_bicgstab_bytes 1.1 * expected_bicgstab_bytes
195+
@test actual_bicgstab_bytes 1.02 * expected_bicgstab_bytes
196196

197197
solver = BicgstabSolver(L, b)
198198
bicgstab!(solver, L, b) # warmup
@@ -208,7 +208,7 @@ function test_alloc()
208208
expected_craigmr_bytes = storage_craigmr_bytes(n, m)
209209
craigmr(Au, c) # warmup
210210
actual_craigmr_bytes = @allocated craigmr(Au, c)
211-
@test actual_craigmr_bytes 1.1 * expected_craigmr_bytes
211+
@test actual_craigmr_bytes 1.02 * expected_craigmr_bytes
212212

213213
solver = CraigmrSolver(Au, c)
214214
craigmr!(solver, Au, c) # warmup
@@ -224,7 +224,7 @@ function test_alloc()
224224
expected_cgne_bytes = storage_cgne_bytes(n, m)
225225
(x, stats) = cgne(Au, c) # warmup
226226
actual_cgne_bytes = @allocated cgne(Au, c)
227-
@test actual_cgne_bytes 1.1 * expected_cgne_bytes
227+
@test actual_cgne_bytes 1.02 * expected_cgne_bytes
228228

229229
solver = CgneSolver(Au, c)
230230
cgne!(solver, Au, c) # warmup
@@ -240,7 +240,7 @@ function test_alloc()
240240
expected_lnlq_bytes = storage_lnlq_bytes(n, m)
241241
lnlq(Au, c) # warmup
242242
actual_lnlq_bytes = @allocated lnlq(Au, c)
243-
@test actual_lnlq_bytes 1.1 * expected_lnlq_bytes
243+
@test actual_lnlq_bytes 1.02 * expected_lnlq_bytes
244244

245245
solver = LnlqSolver(Au, c)
246246
lnlq!(solver, Au, c) # warmup
@@ -256,7 +256,7 @@ function test_alloc()
256256
expected_craig_bytes = storage_craig_bytes(n, m)
257257
craig(Au, c) # warmup
258258
actual_craig_bytes = @allocated craig(Au, c)
259-
@test actual_craig_bytes 1.1 * expected_craig_bytes
259+
@test actual_craig_bytes 1.02 * expected_craig_bytes
260260

261261
solver = CraigSolver(Au, c)
262262
craig!(solver, Au, c) # warmup
@@ -272,7 +272,7 @@ function test_alloc()
272272
expected_lslq_bytes = storage_lslq_bytes(n, m)
273273
(x, stats) = lslq(Ao, b) # warmup
274274
actual_lslq_bytes = @allocated lslq(Ao, b)
275-
@test actual_lslq_bytes 1.1 * expected_lslq_bytes
275+
@test actual_lslq_bytes 1.02 * expected_lslq_bytes
276276

277277
solver = LslqSolver(Ao, b)
278278
lslq!(solver, Ao, b) # warmup
@@ -288,7 +288,7 @@ function test_alloc()
288288
expected_cgls_bytes = storage_cgls_bytes(n, m)
289289
(x, stats) = cgls(Ao, b) # warmup
290290
actual_cgls_bytes = @allocated cgls(Ao, b)
291-
@test actual_cgls_bytes 1.1 * expected_cgls_bytes
291+
@test actual_cgls_bytes 1.02 * expected_cgls_bytes
292292

293293
solver = CglsSolver(Ao, b)
294294
cgls!(solver, Ao, b) # warmup
@@ -304,7 +304,7 @@ function test_alloc()
304304
expected_lsqr_bytes = storage_lsqr_bytes(n, m)
305305
(x, stats) = lsqr(Ao, b) # warmup
306306
actual_lsqr_bytes = @allocated lsqr(Ao, b)
307-
@test actual_lsqr_bytes 1.1 * expected_lsqr_bytes
307+
@test actual_lsqr_bytes 1.02 * expected_lsqr_bytes
308308

309309
solver = LsqrSolver(Ao, b)
310310
lsqr!(solver, Ao, b) # warmup
@@ -320,7 +320,7 @@ function test_alloc()
320320
expected_crls_bytes = storage_crls_bytes(n, m)
321321
(x, stats) = crls(Ao, b) # warmup
322322
actual_crls_bytes = @allocated crls(Ao, b)
323-
@test actual_crls_bytes 1.1 * expected_crls_bytes
323+
@test actual_crls_bytes 1.02 * expected_crls_bytes
324324

325325
solver = CrlsSolver(Ao, b)
326326
crls!(solver, Ao, b) # warmup
@@ -336,7 +336,7 @@ function test_alloc()
336336
expected_lsmr_bytes = storage_lsmr_bytes(n, m)
337337
(x, stats) = lsmr(Ao, b) # warmup
338338
actual_lsmr_bytes = @allocated lsmr(Ao, b)
339-
@test actual_lsmr_bytes 1.1 * expected_lsmr_bytes
339+
@test actual_lsmr_bytes 1.02 * expected_lsmr_bytes
340340

341341
solver = LsmrSolver(Ao, b)
342342
lsmr!(solver, Ao, b) # warmup
@@ -352,7 +352,7 @@ function test_alloc()
352352
expected_usymqr_bytes = storage_usymqr_bytes(n, m)
353353
(x, stats) = usymqr(Lo, b, c) # warmup
354354
actual_usymqr_bytes = @allocated usymqr(Lo, b, c)
355-
@test actual_usymqr_bytes 1.1 * expected_usymqr_bytes
355+
@test actual_usymqr_bytes 1.02 * expected_usymqr_bytes
356356

357357
solver = UsymqrSolver(Lo, b)
358358
usymqr!(solver, Lo, b, c) # warmup
@@ -368,7 +368,7 @@ function test_alloc()
368368
expected_trilqr_bytes = storage_trilqr_bytes(n, n)
369369
trilqr(L, b, b) # warmup
370370
actual_trilqr_bytes = @allocated trilqr(L, b, b)
371-
@test actual_trilqr_bytes 1.1 * expected_trilqr_bytes
371+
@test actual_trilqr_bytes 1.02 * expected_trilqr_bytes
372372

373373
solver = TrilqrSolver(L, b)
374374
trilqr!(solver, L, b, b) # warmup
@@ -383,7 +383,7 @@ function test_alloc()
383383
expected_bilq_bytes = storage_bilq_bytes(n)
384384
bilq(L, b) # warmup
385385
actual_bilq_bytes = @allocated bilq(L, b)
386-
@test actual_bilq_bytes 1.1 * expected_bilq_bytes
386+
@test actual_bilq_bytes 1.02 * expected_bilq_bytes
387387

388388
solver = BilqSolver(L, b)
389389
bilq!(solver, L, b) # warmup
@@ -398,7 +398,7 @@ function test_alloc()
398398
expected_bilqr_bytes = storage_bilqr_bytes(n)
399399
bilqr(L, b, b) # warmup
400400
actual_bilqr_bytes = @allocated bilqr(L, b, b)
401-
@test actual_bilqr_bytes 1.1 * expected_bilqr_bytes
401+
@test actual_bilqr_bytes 1.02 * expected_bilqr_bytes
402402

403403
solver = BilqrSolver(L, b)
404404
bilqr!(solver, L, b, b) # warmup
@@ -411,13 +411,13 @@ function test_alloc()
411411
storage_minres_qlp_bytes(n) = 8 * storage_minres_qlp(n)
412412

413413
expected_minres_qlp_bytes = storage_minres_qlp_bytes(n)
414-
minres_qlp(A, b) # warmup
415-
actual_minres_qlp_bytes = @allocated minres_qlp(A, b)
416-
@test actual_minres_qlp_bytes 1.1 * expected_minres_qlp_bytes
414+
minres_qlp(L, b) # warmup
415+
actual_minres_qlp_bytes = @allocated minres_qlp(L, b)
416+
@test actual_minres_qlp_bytes 1.02 * expected_minres_qlp_bytes
417417

418-
solver = MinresQlpSolver(A, b)
419-
minres_qlp!(solver, A, b) # warmup
420-
inplace_minres_qlp_bytes = @allocated minres_qlp!(solver, A, b)
418+
solver = MinresQlpSolver(L, b)
419+
minres_qlp!(solver, L, b) # warmup
420+
inplace_minres_qlp_bytes = @allocated minres_qlp!(solver, L, b)
421421
@test (VERSION < v"1.5") || (inplace_minres_qlp_bytes == 208)
422422

423423
# QMR needs:
@@ -428,7 +428,7 @@ function test_alloc()
428428
expected_qmr_bytes = storage_qmr_bytes(n)
429429
qmr(L, b) # warmup
430430
actual_qmr_bytes = @allocated qmr(L, b)
431-
@test actual_qmr_bytes 1.1 * expected_qmr_bytes
431+
@test actual_qmr_bytes 1.02 * expected_qmr_bytes
432432

433433
solver = QmrSolver(L, b)
434434
qmr!(solver, L, b) # warmup
@@ -444,7 +444,7 @@ function test_alloc()
444444
expected_usymlq_bytes = storage_usymlq_bytes(n, m)
445445
usymlq(Lu, c, b) # warmup
446446
actual_usymlq_bytes = @allocated usymlq(Lu, c, b)
447-
@test actual_usymlq_bytes 1.1 * expected_usymlq_bytes
447+
@test actual_usymlq_bytes 1.02 * expected_usymlq_bytes
448448

449449
solver = UsymlqSolver(Lu, c)
450450
usymlq!(solver, Lu, c, b) # warmup
@@ -460,7 +460,7 @@ function test_alloc()
460460
expected_tricg_bytes = storage_tricg_bytes(n, m)
461461
tricg(Lu, c, b) # warmup
462462
actual_tricg_bytes = @allocated tricg(Lu, c, b)
463-
@test actual_tricg_bytes 1.1 * expected_tricg_bytes
463+
@test actual_tricg_bytes 1.02 * expected_tricg_bytes
464464

465465
solver = TricgSolver(Lu, c)
466466
tricg!(solver, Lu, c, b) # warmup
@@ -476,7 +476,7 @@ function test_alloc()
476476
expected_trimr_bytes = storage_trimr_bytes(n, m)
477477
trimr(Lu, c, b) # warmup
478478
actual_trimr_bytes = @allocated trimr(Lu, c, b)
479-
@test actual_trimr_bytes 1.1 * expected_trimr_bytes
479+
@test actual_trimr_bytes 1.02 * expected_trimr_bytes
480480

481481
solver = TrimrSolver(Lu, c)
482482
trimr!(solver, Lu, c, b) # warmup

0 commit comments

Comments
 (0)