Skip to content

Commit bf2c34f

Browse files
committed
Define SpecialFunctions.erf. Fixes #232
1 parent 702bbd2 commit bf2c34f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
1818
VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
1919

2020
[compat]
21-
ArrayInterface = "3.1.4"
21+
ArrayInterface = "3.1.7"
2222
CheapThreads = "0.1.3,0.2"
2323
DocStringExtensions = "0.8"
2424
IfElse = "0.1"

src/LoopVectorization.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ using IfElse: ifelse
2929
using ThreadingUtilities, CheapThreads
3030
using SLEEFPirates: pow
3131
using Base.Broadcast: Broadcasted, DefaultArrayStyle
32-
using LinearAlgebra: Adjoint, Transpose
32+
using LinearAlgebra: Adjoint, Transpose, Diagonal
3333
using Base.Meta: isexpr
3434
using DocStringExtensions
3535
import LinearAlgebra # for check_args
@@ -38,7 +38,7 @@ using Base.FastMath: add_fast, sub_fast, mul_fast, div_fast, inv_fast, abs2_fast
3838

3939

4040
using ArrayInterface
41-
using ArrayInterface: OptionallyStaticUnitRange, OptionallyStaticRange, Zero, One, StaticBool, True, False, reduce_tup, indices
41+
using ArrayInterface: OptionallyStaticUnitRange, OptionallyStaticRange, Zero, One, StaticBool, True, False, reduce_tup, indices, UpTri, LoTri
4242
@static if VERSION v"1.6.0-rc1" #TODO: delete `else` when dropping 1.5 support
4343
using ArrayInterface: static_step
4444
else # Julia 1.5 did not define `step` on CartesianIndices
@@ -116,6 +116,9 @@ function __init__()
116116
@require ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" begin
117117
@require ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" include("simdfunctionals/vmap_grad.jl")
118118
end
119+
@require SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" begin
120+
@eval SpecialFunctions.erf(x::VectorizationBase.AbstractSIMD) = VectorizationBase.verf(float(x))
121+
end
119122
end
120123

121124
end # module

src/condense_loopset.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,9 @@ end
387387
end
388388
@inline check_args(A, B, C::Vararg{Any,K}) where {K} = check_args(A) && check_args(B, C...)
389389
@inline check_args(::AbstractRange{T}) where {T} = check_type(T)
390+
@inline check_args(::UpTri) = false
391+
@inline check_args(::LoTri) = false
392+
@inline check_args(::Diagonal) = false
390393
@inline check_args(::Type{T}) where {T} = check_type(T)
391394
"""
392395
check_type(::Type{T}) where {T}

0 commit comments

Comments
 (0)