Skip to content

Commit 51b37e2

Browse files
committed
Added more CartesianIndex tests (to test/dot.jl).
1 parent 4cee72b commit 51b37e2

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

Manifest.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ version = "0.1.0"
6969

7070
[[VectorizationBase]]
7171
deps = ["CpuId", "LinearAlgebra"]
72-
git-tree-sha1 = "a0fd2b18bccacb9874f9d7e95932c16998f399d8"
72+
git-tree-sha1 = "76e8817f7732d9a127191f5bcd5fe3a5eed0fb3e"
7373
uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
74-
version = "0.9.1"
74+
version = "0.9.2"

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ OffsetArrays = "1"
1616
SIMDPirates = "0.7.1"
1717
SLEEFPirates = "0.4"
1818
UnPack = "0"
19-
VectorizationBase = "0.9.1"
19+
VectorizationBase = "0.9.2"
2020
julia = "1.1"
2121

2222
[extras]

test/dot.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ using Test
193193
@show T, @__LINE__
194194
N = 143
195195
R = T <: Integer ? (T(-100):T(100)) : T
196-
a = rand(T, N); b = rand(R, N);
196+
a = rand(R, N); b = rand(R, N);
197197
ao = OffsetArray(a, -60:N-61); bo = OffsetArray(b, -60:N-61);
198198
s = mydot(a, b)
199199
@test mydotavx(a,b) s
@@ -239,5 +239,18 @@ using Test
239239
complex_mul_with_index_offset_avx!(c_re2, c_im2, a_re, a_im, b_re, b_im)
240240
@test c_re1v c_re2v
241241
@test c_im1v c_im2v
242+
243+
# Float32 is not accurate enough
244+
# Alternatively, loosen approx requirement?
245+
R == Float32 && continue
246+
A = rand(R, N, N, N);
247+
B = rand(R, N, N, N);
248+
@test mydot(A, B) mydotavx(A, B)
249+
# test CartesianIndices
250+
for i [3, :, 1:N-1], j [5, :, 1:N-2], k [:, 1:N-3]
251+
Av = view(A, i, j, k);
252+
Bv = view(B, i, j, k);
253+
@test mydot(Av, Bv) mydotavx(Av, Bv)
254+
end
242255
end
243256
end

0 commit comments

Comments
 (0)