Skip to content

Commit

Permalink
Add scalar-VecUnroll method for log_fast
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Mar 20, 2021
1 parent b6b86da commit 4562f05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SLEEFPirates"
uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa"
authors = ["chriselrod <[email protected]>"]
version = "0.6.12"
version = "0.6.13"

[deps]
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
Expand Down
7 changes: 7 additions & 0 deletions src/log.jl
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,11 @@ else
@inline log_fast(d::AbstractSIMD) = log_fast(float(d), False())
end
@inline log_fast(d::Union{Float32,Float64}) = log_fast(d, False())
@generated function log_fast(x::VecUnroll{N,1,T,T}) where {N,T}
quote
$(Expr(:meta,:inline))
lx = log_fast(VectorizationBase.transpose_vecunroll(x))
VecUnroll(Base.Cartesian.@ntuple $(N+1) n -> lx(n))
end
end

0 comments on commit 4562f05

Please sign in to comment.