diff --git a/Project.toml b/Project.toml index 3b470ef..bd91389 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "VectorizationBase" uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" authors = ["Chris Elrod "] -version = "0.21.65" +version = "0.21.66" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" diff --git a/src/VectorizationBase.jl b/src/VectorizationBase.jl index fdd2a9e..306e586 100644 --- a/src/VectorizationBase.jl +++ b/src/VectorizationBase.jl @@ -91,6 +91,15 @@ using LayoutPointers: using Static using Static: One, Zero, eq, ne, lt, le, gt, ge +@inline function promote(x::X, y::Y) where {X,Y} + T = promote_type(X, Y) + convert(T, x), convert(T, y) +end +@inline function promote(x::X, y::Y, z::Z) where {X,Y,Z} + T = promote_type(promote_type(X, Y), Z) + convert(T, x), convert(T, y), convert(T, z) +end + asbool(::Type{True}) = true asbool(::Type{False}) = false # TODO: see if `@inline` is good enough.