@@ -6,7 +6,6 @@ export IVM
66const IVM = IntelVectorMath
77
88# import Base: .^, ./
9- using SpecialFunctions
109# using Libdl
1110include(" ../deps/deps.jl" )
1211
@@ -104,47 +103,6 @@ for t in (Float32, Float64)
104103 # def_binary_op(Complex{t}, Complex{t}, :multiply_conj, :multiply_conj!, :Mul, false)
105104end
106105
107- """
108- @overload exp log sin
109-
110- This macro adds a method to each function in `Base` (or perhaps in `SpecialFunctions`),
111- so that when acting on an array (or two arrays) it calls the `IntelVectorMath` function of the same name.
112-
113- The existing action on scalars is unaffected. However, `exp(M::Matrix)` will now mean
114- element-wise `IntelVectorMath.exp(M) == exp.(M)`, rather than matrix exponentiation.
115- """
116- macro overload(funs... )
117- out = quote end
118- say = []
119- for f in funs
120- if f in _UNARY
121- if isdefined(Base, f)
122- push!(out. args, :( Base.$ f(A:: Array ) = IntelVectorMath.$ f(A) ))
123- push!(say, " Base.$f (A)" )
124- elseif isdefined(SpecialFunctions, f)
125- push!(out. args, :( IntelVectorMath. SpecialFunctions.$ f(A:: Array ) = IntelVectorMath.$ f(A) ))
126- push!(say, " SpecialFunctions.$f (A)" )
127- else
128- @error " function IntelVectorMath.$f is not defined in Base or SpecialFunctions, so there is nothing to overload"
129- end
130- end
131- if f in _BINARY
132- if isdefined(Base, f)
133- push!(out. args, :( Base.$ f(A:: Array , B:: Array ) = IntelVectorMath.$ f(A, B) ))
134- push!(say, " Base.$f (A, B)" )
135- else
136- @error " function IntelVectorMath.$f is not defined in Base, so there is nothing to overload"
137- end
138- end
139- if ! (f in _UNARY) && ! (f in _BINARY)
140- error(" there is no function $f defined by IntelVectorMath.jl" )
141- end
142- end
143- str = string(" Overloaded these functions: \n " , join(say, " \n " ))
144- push!(out. args, str)
145- esc(out)
146- end
147-
148- export VML_LA, VML_HA, VML_EP, vml_set_accuracy, vml_get_accuracy, @overload
106+ export VML_LA, VML_HA, VML_EP, vml_set_accuracy, vml_get_accuracy
149107
150108end
0 commit comments