Skip to content

Commit 9537e6a

Browse files
committed
Surround memory for offsetarray test matrix A with NaNs.
1 parent 56214fd commit 9537e6a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/offsetarrays.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,14 @@ using LoopVectorization.VectorizationBase: StaticUnitRange
200200

201201
for T (Float32, Float64)
202202
@show T, @__LINE__
203-
A = rand(T, 100, 100); At = copy(A');
203+
Abase = fill(T(NaN), 200, 200);
204+
A = view(Abase, 51:150, 51:150);
205+
A .= rand.();
206+
Atbase = copy(Abase');
207+
At = view(Atbase, 51:150, 51:150);
204208
for r (-1:1, -2:2)
205209
@show r
206-
fr = first(r); lr = last(r);
210+
fr = first(r); lr = last(r);
207211
kern = OffsetArray(rand(T, length(r), length(r)), r, r);
208212
out1 = OffsetArray(view(similar(A, size(A) .+ 32), (1+lr:100-lr) .+ 32, (1+lr:100-lr) .+ 32), lr, lr); # stay away from the edges of A
209213
# out1 = OffsetArray(similar(A, size(A).-2), 1, 1); # stay away from the edges of A

0 commit comments

Comments
 (0)