Skip to content

Commit

Permalink
Mask (EVL)Mask{1}(b::Bool) return b
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed May 11, 2021
1 parent 4f95767 commit 01ff9ae
Show file tree
Hide file tree
Showing 3 changed files with 7 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 = "VectorizationBase"
uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
authors = ["Chris Elrod <[email protected]>"]
version = "0.19.37"
version = "0.19.38"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand Down
2 changes: 2 additions & 0 deletions src/VectorizationBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ struct EVLMask{W,U} <: AbstractMask{W,U}
end
@inline Mask{W}(u::U) where {W,U<:Unsigned} = Mask{W,U}(u)
@inline EVLMask{W}(u::U, i) where {W,U<:Unsigned} = EVLMask{W,U}(u, i)
@inline Mask{1}(b::Bool) = b
@inline EVLMask{1}(b::Bool, i) = b
@inline Mask(m::EVLMask{W,U}) where {W,U} = Mask{W,U}(getfield(m,:u))
# Const prop is good enough; added an @inferred test to make sure.
# Removed because confusion can cause more harm than good.
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ include("testsetup.jl")
@test EVLMask{12,UInt16}(0x01ff, 9) === mask(Val(12), 117)
@test VectorizationBase.data(mask(Val(128),253)) == 0x1fffffffffffffffffffffffffffffff
@test mask(Val(128),253) === EVLMask{128,UInt128}(0x1fffffffffffffffffffffffffffffff, 125)
@test EVLMask{1}(true, 1) === true
@test Mask{1}(true) === true
@test EVLMask{1}(false, 1) === false
@test Mask{1}(false) === false
@test all(w -> VectorizationBase.mask_type(w) === UInt8, 1:8)
@test all(w -> VectorizationBase.mask_type(w) === UInt16, 9:16)
@test all(w -> VectorizationBase.mask_type(w) === UInt32, 17:32)
Expand Down

2 comments on commit 01ff9ae

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

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.19.38 -m "<description of version>" 01ff9aed6dba13d1744c9c8e74d6643b0a63dd3a
git push origin v0.19.38

Please sign in to comment.