Skip to content

Commit 80e7f22

Browse files
committed
Fixed test error in Julia 1.3 and a couple README typos.
1 parent 2922c1b commit 80e7f22

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ At small sizes, this can be fast.
173173
<summaryClick me! ></summary>
174174
<p>
175175

176-
The key to the `@avx` macro's performance gains is leveraging knowledge of exactly how data like `Float64`s and `Int`s are handled by a CPU. As such, it is not strightforward to generalize the `@avx` macro to work on arrays conatining structs such as `Matrix{Complex{Float64}}`. Instead, it is currently reccomended that users wishing to apply `@avx` to arrays of structs use packages such as [StructArrays.jl](https://github.com/JuliaArrays/StructArrays.jl) which transform an array where each element is a struct into a struct where each element is an array. Using StructArrays.jl, we can write a matrix multiply (gemm) kernel that works on matrices of `Complex{Float64}`s and `Complex{Int}`s:
176+
The key to the `@avx` macro's performance gains is leveraging knowledge of exactly how data like `Float64`s and `Int`s are handled by a CPU. As such, it is not strightforward to generalize the `@avx` macro to work on arrays containing structs such as `Matrix{Complex{Float64}}`. Instead, it is currently recommended that users wishing to apply `@avx` to arrays of structs use packages such as [StructArrays.jl](https://github.com/JuliaArrays/StructArrays.jl) which transform an array where each element is a struct into a struct where each element is an array. Using StructArrays.jl, we can write a matrix multiply (gemm) kernel that works on matrices of `Complex{Float64}`s and `Complex{Int}`s:
177177
```julia
178178
using LoopVectorization, LinearAlgebra, StructArrays, BenchmarkTools, Test
179179

test/runtests.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,11 @@ using LinearAlgebra
345345
lsdot3 = LoopVectorization.LoopSet(dot3q);
346346
LoopVectorization.choose_order(lsdot3)
347347

348-
# dot3(x, A, y) = dot(x, A * y)
348+
@static if VERSION < v"1.4"
349+
dot3(x, A, y) = dot(x, A * y)
350+
else
351+
dot3(x, A, y) = dot(x, A, y)
352+
end
349353
function dot3avx(x, A, y)
350354
M, N = size(A)
351355
s = zero(promote_type(eltype(x), eltype(A), eltype(y)))
@@ -450,7 +454,7 @@ using LinearAlgebra
450454

451455
M, N = 47, 73;
452456
x = rand(T, M); A = rand(T, M, N); y = rand(T, N);
453-
@test dot3avx(x, A, y) dot(x, A, y)
457+
@test dot3avx(x, A, y) dot3(x, A, y)
454458

455459
end
456460
end

0 commit comments

Comments
 (0)