Skip to content

Commit 4dd1fcd

Browse files
committed
test non-square sizes
1 parent 2465016 commit 4dd1fcd

File tree

1 file changed

+49
-47
lines changed

1 file changed

+49
-47
lines changed

test/shuffleloadstores.jl

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -333,60 +333,62 @@ end
333333

334334

335335
@testset "shuffles load/stores" begin
336-
@show @__LINE__
337-
for i 1:128
338-
ac = rand(Complex{Float64}, i);
339-
bc = rand(Complex{Float64}, i);
340-
dsimd = dot_simd(ac, bc)
341-
if VERSION v"1.6.0-rc1"
342-
@test dsimd cdot_mat(ac, bc)
343-
end
344-
@test dsimd cdot_affine(ac, bc) cdot_stride(ac, bc)
336+
@show @__LINE__
337+
for i 1:128
338+
ac = rand(Complex{Float64}, i);
339+
bc = rand(Complex{Float64}, i);
340+
dsimd = dot_simd(ac, bc)
341+
if VERSION v"1.6.0-rc1"
342+
@test dsimd cdot_mat(ac, bc)
343+
end
344+
@test dsimd cdot_affine(ac, bc) cdot_stride(ac, bc)
345345

346346

347-
xq = [ntuple(_ -> rand(), Val(4)) for _ 1:i];
348-
yq = [ntuple(_ -> rand(), Val(4)) for _ 1:i];
349-
xqv = reinterpret(Float64, xq);
350-
yqv = reinterpret(Float64, yq);
351-
qsimd = Base.vect(qdot_simd(xq, yq)...);
352-
if VERSION v"1.6.0-rc1"
353-
xqm = reinterpret(reshape, Float64, xq);
354-
yqm = reinterpret(reshape, Float64, yq);
355-
@test qsimd Base.vect(qdot_mat(xqm, yqm)...)
356-
end
357-
@test qsimd Base.vect(qdot_affine(xqv, yqv)...) Base.vect(qdot_stride(xqv, yqv)...)
358-
359-
if VERSION v"1.6.0-rc1"
360-
Ac = rand(Complex{Float64}, i, i);
361-
Bc = rand(Complex{Float64}, i, i);
362-
Cc1 = Ac*Bc;
363-
Cc2 = similar(Cc1);
364-
Cc3 = similar(Cc1)
365-
@test Cc1 cmatmul_array!(Cc2, Ac, Bc)
366-
Cc2 .= NaN
367-
@test Cc1 cmatmul_array_v2!(Cc2, Ac, Bc)
368-
end
347+
xq = [ntuple(_ -> rand(), Val(4)) for _ 1:i];
348+
yq = [ntuple(_ -> rand(), Val(4)) for _ 1:i];
349+
xqv = reinterpret(Float64, xq);
350+
yqv = reinterpret(Float64, yq);
351+
qsimd = Base.vect(qdot_simd(xq, yq)...);
352+
if VERSION v"1.6.0-rc1"
353+
xqm = reinterpret(reshape, Float64, xq);
354+
yqm = reinterpret(reshape, Float64, yq);
355+
@test qsimd Base.vect(qdot_mat(xqm, yqm)...)
369356
end
370-
@show @__LINE__
357+
@test qsimd Base.vect(qdot_affine(xqv, yqv)...) Base.vect(qdot_stride(xqv, yqv)...)
358+
371359
if VERSION v"1.6.0-rc1"
372-
M = 10
373-
G = 50
374-
J = 50
375-
H = 30
360+
for j max(1,i-5):i+5, k max(1,i-5,i+5)
361+
Ac = rand(Complex{Float64}, j, i);
362+
Bc = rand(Complex{Float64}, i, k);
363+
Cc1 = Ac*Bc;
364+
Cc2 = similar(Cc1);
365+
Cc3 = similar(Cc1);
366+
@test Cc1 cmatmul_array!(Cc2, Ac, Bc)
367+
Cc2 .= NaN;
368+
@test Cc1 cmatmul_array_v2!(Cc2, Ac, Bc)
369+
end
370+
end
371+
end
372+
@show @__LINE__
373+
if VERSION v"1.6.0-rc1"
374+
M = 10
375+
G = 50
376+
J = 50
377+
H = 30
376378

377-
# B = rand(Complex{Float64}, 2*J+1, G-1, H+1, M+1);
378-
# ϕ = rand(Complex{Float64}, 2*J+1, G+1, H+1, M+1);
379-
rbc = let rb = 1.0:((2*J+17) * (G+15) * (H+17) * (M+17)), rbr = reverse(rb)
380-
Complex{Float64}[rb[i] + im * rbr[i] for i eachindex(rb)];
381-
end
382-
B = view(reshape(rbc, (2*J+17, G+15, H+17, M+17)), 9:2*J+9, 9:G+9, 9:H+9, 9:M+9) .= rand.() .+ rand.().*im;
383-
ϕ = view(fill(1e5+1e7im, 2*J+17, G+17, H+17, M+17), 9:2*J+9, 9:G+9, 9:H+9, 9:M+9) .= rand.() .+ rand.().*im;
384-
@test issue209(M, G, J, H, B, ϕ) issue209_noavx(M, G, J, H, B, ϕ)
379+
# B = rand(Complex{Float64}, 2*J+1, G-1, H+1, M+1);
380+
# ϕ = rand(Complex{Float64}, 2*J+1, G+1, H+1, M+1);
381+
rbc = let rb = 1.0:((2*J+17) * (G+15) * (H+17) * (M+17)), rbr = reverse(rb)
382+
Complex{Float64}[rb[i] + im * rbr[i] for i eachindex(rb)];
385383
end
384+
B = view(reshape(rbc, (2*J+17, G+15, H+17, M+17)), 9:2*J+9, 9:G+9, 9:H+9, 9:M+9) .= rand.() .+ rand.().*im;
385+
ϕ = view(fill(1e5+1e7im, 2*J+17, G+17, H+17, M+17), 9:2*J+9, 9:G+9, 9:H+9, 9:M+9) .= rand.() .+ rand.().*im;
386+
@test issue209(M, G, J, H, B, ϕ) issue209_noavx(M, G, J, H, B, ϕ)
387+
end
386388

387-
s = Array{Float64}(undef, 4, 128, 128);
388-
s2 = rand(4, 2, 128, 128);
389-
@test sumdim2_turbo!(s, s2) sumdim2!(similar(s), s2)
389+
s = Array{Float64}(undef, 4, 128, 128);
390+
s2 = rand(4, 2, 128, 128);
391+
@test sumdim2_turbo!(s, s2) sumdim2!(similar(s), s2)
390392

391393
# issue 287
392394
out_test = zeros(100, 10);

0 commit comments

Comments
 (0)