Skip to content

Commit

Permalink
Fix dot tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Jan 25, 2021
1 parent 8b2fceb commit 5cb555e
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions test/dot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using Test
end)
lsdot = LoopVectorization.LoopSet(dotq);
@test LoopVectorization.choose_order(lsdot) == (Symbol[:i], :i, Symbol("##undefined##"), :i, 4, -1)
function mydot(a, b)
function mydot(a::AbstractVector, b::AbstractVector)
s = zero(eltype(a))
za = OffsetArray(a, OffsetArrays.Origin(0))
zb = OffsetArray(b, OffsetArrays.Origin(0))
Expand All @@ -16,7 +16,7 @@ using Test
end
s
end
function mydotavx(a, b)
function mydotavx(a::AbstractVector, b::AbstractVector)
s = zero(eltype(a))
za = OffsetArray(a, OffsetArrays.Origin(0))
zb = OffsetArray(b, OffsetArrays.Origin(0))
Expand All @@ -25,6 +25,21 @@ using Test
end
s
end
@test LoopVectorization.ArrayInterface.static_step(LoopVectorization.CloseOpen(-5,10)) === LoopVectorization.One()
function mydot(a, b)
s = zero(eltype(a))
@inbounds @simd for i eachindex(a,b)
s += a[i]*b[i]
end
s
end
function mydotavx(a, b)
s = zero(eltype(a))
@avx for i eachindex(a,b)
s += a[i]*b[i]
end
s
end

function mydot_avx(a, b)
s = zero(eltype(a))
Expand Down

2 comments on commit 5cb555e

@chriselrod
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/28603

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.0 -m "<description of version>" 5cb555ed34ee61b2a72b64fdde68a6d15290a66c
git push origin v0.10.0

Please sign in to comment.