@@ -147,18 +147,20 @@ using Test
147
147
@test LoopVectorization. choose_order (lsp) == ([:d1 , :d2 ], :d2 , :d1 , :d2 , Unum, Tnum)
148
148
# lsp.preamble_symsym
149
149
150
- function hhavx! (A, B, C, D)
150
+ function hhavx! (A:: AbstractVector{T} , B, C, D) where {T}
151
+ L = T (length (axes (B,2 )));
151
152
@avx for i in axes (A, 1 )
152
- A[i] = A[i] + D[i] * length ( axes (B, 2 ));
153
+ A[i] = A[i] + D[i] * L
153
154
for j = axes (B, 2 )
154
155
B[i, j] = B[i, j] + D[i]
155
156
C[j] = C[j] + D[i]
156
157
end
157
158
end
158
159
end
159
- function hh! (A, B, C, D)
160
+ function hh! (A:: AbstractVector{T} , B, C, D) where {T}
161
+ L = T (length (axes (B,2 )));
160
162
@inbounds @fastmath for i in axes (A, 1 )
161
- A[i] = A[i] + D[i] * length ( axes (B, 2 ));
163
+ A[i] = A[i] + D[i] * L
162
164
for j = axes (B, 2 )
163
165
B[i, j] = B[i, j] + D[i]
164
166
C[j] = C[j] + D[i]
@@ -211,10 +213,10 @@ using Test
211
213
fill! (G2, TC (NaN )); AtmulvB_avx3! (G2,B,1 );
212
214
@test G1 ≈ G2
213
215
214
- D = rand (T , M);
215
- B1 = rand (T , M,N); B2 = copy (B1);
216
- C1 = rand (T , N); C2 = copy (C1);
217
- A1 = rand (T , size (D)... ); A2 = copy (A1);
216
+ D = rand (R , M);
217
+ B1 = rand (R , M,N); B2 = copy (B1);
218
+ C1 = rand (R , N); C2 = copy (C1);
219
+ A1 = rand (R , size (D)... ); A2 = copy (A1);
218
220
hh! (A1, B1, C1, D)
219
221
hhavx! (A2, B2, C2, D)
220
222
@test B1 ≈ B2
0 commit comments