Skip to content

Commit c183773

Browse files
committed
Accidentally forgot to comment lines in offsetarrays tests, and updated 16-register tests.
1 parent 8cb248c commit c183773

File tree

2 files changed

+33
-18
lines changed

2 files changed

+33
-18
lines changed

test/miscellaneous.jl

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ using Test
44

55
@testset "Miscellaneous" begin
66

7-
Unum, Tnum = LoopVectorization.VectorizationBase.REGISTER_COUNT == 16 ? (3, 3) : (4, 4)
7+
Unum, Tnum = LoopVectorization.VectorizationBase.REGISTER_COUNT == 16 ? (3, 4) : (4, 4)
88
dot3q = :(for m 1:M, n 1:N
99
s += x[m] * A[m,n] * y[n]
1010
end);
1111
lsdot3 = LoopVectorization.LoopSet(dot3q);
12-
@test LoopVectorization.choose_order(lsdot3) == ([:n, :m], :n, :m, :m, Unum, Tnum)#&-2
12+
if LoopVectorization.VectorizationBase.REGISTER_COUNT == 32
13+
@test LoopVectorization.choose_order(lsdot3) == ([:n, :m], :n, :m, :m, Unum, Tnum)#&-2
14+
else
15+
@test LoopVectorization.choose_order(lsdot3) == ([:n, :m], :m, :n, :m, Unum, Tnum)#&-2
16+
end
1317

1418
@static if VERSION < v"1.4"
1519
dot3(x, A, y) = dot(x, A * y)
@@ -57,7 +61,11 @@ using Test
5761
B[j,i] = A[j,i] - x[j]
5862
end)
5963
lssubcol = LoopVectorization.LoopSet(subcolq);
60-
@test LoopVectorization.choose_order(lssubcol) == (Symbol[:j,:i], :j, :i, :j, 4, 6)
64+
if LoopVectorization.VectorizationBase.REGISTER_COUNT == 32
65+
@test LoopVectorization.choose_order(lssubcol) == (Symbol[:j,:i], :j, :i, :j, 4, 6)
66+
else
67+
@test LoopVectorization.choose_order(lssubcol) == ([:j, :i], :j, :i, :j, 3, 4)#&-2
68+
end
6169
## @avx is SLOWER!!!!
6270
## need to fix!
6371
function mysubcol!(B, A, x)
@@ -82,8 +90,11 @@ using Test
8290
x[j] += A[j,i] - 0.25
8391
end)
8492
lscolsum = LoopVectorization.LoopSet(colsumq);
85-
@test LoopVectorization.choose_order(lscolsum) == (Symbol[:j,:i], :j, :i, :j, 4, 6)
86-
93+
if LoopVectorization.VectorizationBase.REGISTER_COUNT == 32
94+
@test LoopVectorization.choose_order(lscolsum) == (Symbol[:j,:i], :j, :i, :j, 4, 6)
95+
else
96+
@test LoopVectorization.choose_order(lscolsum) == (Symbol[:j,:i], :j, :i, :j, 3, 4)
97+
end
8798
# my colsum is wrong (by 0.25), but slightly more interesting
8899
function mycolsum!(x, A)
89100
@. x = 0
@@ -119,8 +130,12 @@ using Test
119130
lsvar = LoopVectorization.LoopSet(varq);
120131
# LoopVectorization.choose_order(lsvar)
121132
# @test LoopVectorization.choose_order(lscolsum) == (Symbol[:j,:i], :j, Symbol("##undefined##"), :j, 4, -1)
122-
@test LoopVectorization.choose_order(lsvar) == (Symbol[:j,:i], :j, :i, :j, 4, 6)
123-
133+
if LoopVectorization.VectorizationBase.REGISTER_COUNT == 32
134+
@test LoopVectorization.choose_order(lsvar) == (Symbol[:j,:i], :j, :i, :j, 4, 6)
135+
else
136+
@test LoopVectorization.choose_order(lsvar) == (Symbol[:j,:i], :j, :i, :j, 4, 4)
137+
end
138+
124139
function myvar!(s², A, x̄)
125140
@.= 0
126141
@inbounds for i 1:size(A,2)

test/offsetarrays.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ T = Float64
2929
# tmp += A[i+ik,j+jk]*skern[ik,jk]
3030
# end;
3131
# ls1
32-
out = out1;
33-
rng1, rng2 = CartesianIndices(out1).indices;
34-
rng1k, rng2k = axes(skern);
35-
ls2dstatic = LoopVectorization.@avx_debug for j in rng2, i in rng1
36-
tmp = zero(eltype(out))
37-
for jk in rng2k, ik in rng1k
38-
tmp += A[i+ik,j+jk]*skern[ik,jk]
39-
end
40-
out1[i,j] = tmp
41-
end;
42-
LoopVectorization.choose_order(ls2dstatic)
32+
# out = out1;
33+
# rng1, rng2 = CartesianIndices(out1).indices;
34+
# rng1k, rng2k = axes(skern);
35+
# ls2dstatic = LoopVectorization.@avx_debug for j in rng2, i in rng1
36+
# tmp = zero(eltype(out))
37+
# for jk in rng2k, ik in rng1k
38+
# tmp += A[i+ik,j+jk]*skern[ik,jk]
39+
# end
40+
# out1[i,j] = tmp
41+
# end;
42+
# LoopVectorization.choose_order(ls2dstatic)
4343
# q2d = :(for j in rng2, i in rng1
4444
# tmp = zero(eltype(out))
4545
# for jk in rng2k, ik in rng1k

0 commit comments

Comments
 (0)