Skip to content

Commit e8b2d0d

Browse files
committed
Improve test coverage
1 parent b4f79a6 commit e8b2d0d

File tree

8 files changed

+89
-70
lines changed

8 files changed

+89
-70
lines changed

.github/workflows/ci-julia-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- uses: julia-actions/julia-buildpkg@v1
5252
- uses: julia-actions/julia-runtest@v1
5353
env:
54-
JULIA_NUM_THREADS: 2
54+
JULIA_NUM_THREADS: 4
5555
- uses: julia-actions/julia-processcoverage@v1
5656
- uses: codecov/codecov-action@v1
5757
with:

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- uses: julia-actions/julia-buildpkg@v1
5353
- uses: julia-actions/julia-runtest@v1
5454
env:
55-
JULIA_NUM_THREADS: 2
55+
JULIA_NUM_THREADS: 4
5656
- uses: julia-actions/julia-processcoverage@v1
5757
- uses: codecov/codecov-action@v1
5858
with:

src/codegen/line_number_nodes.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
function extract_all_lnns(x)
2-
lnns = Vector{LineNumberNode}(undef, 0)
3-
extract_all_lnns!(lnns, x)
4-
return lnns
2+
lnns = Vector{LineNumberNode}(undef, 0)
3+
return extract_all_lnns!(lnns, x)
54
end
65

76
function extract_all_lnns!(lnns::AbstractVector{<:LineNumberNode}, lnn::LineNumberNode)

src/codegen/lower_memory_common.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ end
1515

1616
staticexpr(x::Int) = Expr(:call, Expr(:curly, lv(:StaticInt), x))
1717
staticexpr(x::Union{Symbol,Expr}) = Expr(:call, lv(:StaticInt), x)
18-
maybestatic(x::Int) = staticexpr(x)
19-
maybestatic(x::Union{Symbol,Expr}) = x
2018

2119
_MMind(ind::Union{Symbol,Expr}, str::Int) = Expr(:call, lv(:MM), VECTORWIDTHSYMBOL, ind, staticexpr(str))
2220
_MMind(ind::Int, str::Int) = Expr(:call, lv(:MM), VECTORWIDTHSYMBOL, staticexpr(ind), staticexpr(str))

src/codegen/lowering.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ function lower_block(
9393
end
9494

9595
assume(ex) = Expr(:call, GlobalRef(VectorizationBase, :assume), ex)
96-
function expect(ex)
97-
# Expr(:call, GlobalRef(VectorizationBase, :expect), ex)
98-
ex
99-
end
10096
function loopiteratesatleastonce!(ls, loop::Loop)
10197
start = first(loop); stop = last(loop)
10298
(isknown(start) & isknown(stop)) && return loop

test/gemv.jl

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -73,34 +73,36 @@ using Test
7373
# LoopVectorization.lower(ls, 2, 2, 0)
7474

7575

76-
function AtmulvB!(G, B,κ)
77-
d = size(G,1)
78-
@inbounds for d1=1:d
79-
G[d1,κ] = B[1,d1]*B[1,κ]
80-
for d2=2:d
81-
G[d1,κ] += B[d2,d1]*B[d2,κ]
82-
end
83-
end
76+
function AtmulvB!(G, B, κ)
77+
d = size(G,1)
78+
@inbounds for d1=1:d
79+
G[d1,κ] = B[1,d1]*B[1,κ]
80+
for d2=2:d
81+
G[d1,κ] += B[d2,d1]*B[d2,κ]
82+
end
8483
end
85-
function AtmulvBavx1!(G, B,κ)
86-
d = size(G,1)
87-
z = zero(eltype(G))
88-
@avx for d1=1:d
89-
G[d1,κ] = z
90-
for d2=1:d
91-
G[d1,κ] += B[d2,d1]*B[d2,κ]
92-
end
93-
end
84+
end
85+
function AtmulvBavx1!(G, B, κ)
86+
d = size(G,1)
87+
δ = 0
88+
z = zero(eltype(G))
89+
@avx for d1=1:d
90+
G[d1,κ] = z
91+
for d2=1:d
92+
G[d1, κ - δ] += B[d2, d1] * B[d2, κ + δ]
93+
end
9494
end
95+
end
9596
function AtmulvBavx2!(G, B,κ)
96-
d = size(G,1)
97-
@avx for d1=1:d
98-
z = zero(eltype(G))
99-
for d2=1:d
100-
z += B[d2,d1]*B[d2,κ]
101-
end
102-
G[d1,κ] = z
97+
d = size(G,1)
98+
δ = 0
99+
@avx for d1=1:d
100+
z = zero(eltype(G))
101+
for d2=1:d
102+
z += B[d2 - δ, d1]*B[d2, κ - δ]
103103
end
104+
G[d1,κ] = z
105+
end
104106
end
105107
function AtmulvBavx3!(G, B,κ)
106108
d = size(G,1)

test/iteration_bound_tests.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
@testset "Iteration Bound Tests" begin
3+
function masktest_incr1_none1start!(y,x)
4+
@spmd for i 0:20
5+
y[i] = x[i] + 2
6+
end
7+
end
8+
function masktest_incr2_none1start!(y,x)
9+
@spmd for i 0:2:20
10+
y[i] = x[i] + 2
11+
end
12+
end
13+
14+
x = OffsetVector(rand(24),0:23);
15+
y = copy(x);
16+
masktest_incr1_none1start!(y,x)
17+
@test y == x .+ ifelse.(axes(x,1) .≤ 20, 2, 0)
18+
@spmd y .= x;
19+
@test y == x
20+
masktest_incr2_none1start!(y,x)
21+
@test y == x .+ ifelse.((axes(x,1) .≤ 20) .& iseven.(axes(x,1)), 2, 0)
22+
end

test/runtests.jl

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,66 +12,68 @@ const START_TIME = time()
1212

1313
@time @testset "LoopVectorization.jl" begin
1414

15-
@time Aqua.test_all(LoopVectorization)
16-
# @test isempty(detect_unbound_args(LoopVectorization))
15+
@time Aqua.test_all(LoopVectorization)
16+
# @test isempty(detect_unbound_args(LoopVectorization))
1717

18-
@time include("printmethods.jl")
18+
@time include("printmethods.jl")
1919

20-
@time include("can_avx.jl")
20+
@time include("can_avx.jl")
2121

22-
@time include("fallback.jl")
22+
@time include("fallback.jl")
2323

24-
@time include("utils.jl")
24+
@time include("utils.jl")
2525

26-
@time include("arraywrappers.jl")
26+
@time include("arraywrappers.jl")
2727

28-
@time include("check_empty.jl")
28+
@time include("check_empty.jl")
2929

30-
@time include("loopinductvars.jl")
30+
@time include("loopinductvars.jl")
3131

32-
@time include("shuffleloadstores.jl")
32+
@time include("shuffleloadstores.jl")
3333

34-
if (v"1.5" < VERSION < v"1.7") && Sys.iswindows()
35-
println("Skipping Zygote tests.")
36-
else
37-
@time include("zygote.jl")
38-
end
34+
if (v"1.5" < VERSION < v"1.7") && Sys.iswindows()
35+
println("Skipping Zygote tests.")
36+
else
37+
@time include("zygote.jl")
38+
end
3939

40-
@time include("offsetarrays.jl")
40+
@time include("offsetarrays.jl")
4141

42-
@time include("tensors.jl")
42+
@time include("tensors.jl")
4343

44-
@time include("map.jl")
44+
@time include("map.jl")
4545

46-
@time include("filter.jl")
47-
48-
@time include("mapreduce.jl")
46+
@time include("filter.jl")
47+
48+
@time include("mapreduce.jl")
4949

50-
@time include("ifelsemasks.jl")
50+
@time include("ifelsemasks.jl")
5151

52-
@time include("dot.jl")
52+
@time include("dot.jl")
5353

54-
@time include("special.jl")
54+
@time include("special.jl")
5555

56-
@time include("gemv.jl")
56+
@time include("gemv.jl")
5757

58-
@time include("miscellaneous.jl")
58+
@time include("miscellaneous.jl")
5959

60-
@time include("copy.jl")
60+
@time include("copy.jl")
6161

62-
@time include("broadcast.jl")
62+
@time include("broadcast.jl")
6363

64-
@time include("gemm.jl")
64+
@time include("gemm.jl")
6565

66-
@time include("threading.jl")
66+
@time include("threading.jl")
6767

68-
@time include("tullio.jl")
68+
@time include("tullio.jl")
6969

70-
@time include("staticsize.jl")
70+
@time include("staticsize.jl")
7171

72-
if VERSION v"1.6"
73-
@time include("quantum.jl")
74-
end
72+
@time include("iteration_bound_tests.jl")
73+
74+
if VERSION v"1.6"
75+
@time include("quantum.jl")
76+
end
7577
end
7678

7779
const ELAPSED_MINUTES = (time() - START_TIME)/60

0 commit comments

Comments
 (0)