Skip to content

Commit

Permalink
Fix vcount
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Apr 6, 2023
1 parent 6d7b07e commit ad545d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/simdfunctionals/count.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_vcount(f) = 0
function _vcount(f::F, args::Vararg{DenseArray,M}) where {F,M}
function _vcount(f::F, args::Vararg{StridedArray,M}) where {F,M}
x = first(args)
y = Base.tail(args)
foreach(a -> @assert(size(a) == size(x)), y)
Expand Down Expand Up @@ -36,10 +36,10 @@ function _vcount(f::F, args::Vararg{DenseArray,M}) where {F,M}
count
end

@generated function vcount(f::F, args::Vararg{DenseArray,M}) where {F,M}
@generated function vcount(f::F, args::Vararg{StridedArray,M}) where {F,M}
call = Expr(:call, :_vcount, :f)
gc_preserve_call_quote(call, M::Int)
end
vcount(::typeof(identity), x::AbstractArray{Bool}) =
vcount(::typeof(identity), x::StridedArray{Bool}) =
vcount(VectorizationBase.tomask, x)
vcount(x::AbstractArray{Bool}) = vcount(VectorizationBase.tomask, x)
vcount(x::StridedArray{Bool}) = vcount(VectorizationBase.tomask, x)

2 comments on commit ad545d9

@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/81173

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.12.157 -m "<description of version>" ad545d98bdf0442cfa88b80b86abc66b75630236
git push origin v0.12.157

Please sign in to comment.