Skip to content

Add cdfnorm to available functions. #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Build folder of Documenter.jl
docs/build/
Manifest.toml
.vscode
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "IntelVectorMath"
uuid = "c8ce9da6-5d36-5c03-b118-5a70151be7bc"
version = "0.4.3"
version = "0.5.0"

[deps]
MKL_jll = "856f044c-d86e-5d09-b602-aeab76dc8ba7"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This package provides bindings to the Intel MKL [Vector Mathematics Functions](h
This is often substantially faster than broadcasting Julia's built-in functions, especially when applying a transcendental function over a large array.
Until Julia 0.6 the package was registered as `VML.jl`.

Similar packages are [Yeppp.jl](https://github.com/JuliaMath/Yeppp.jl), which wraps the open source Yeppp library, and [AppleAccelerate.jl](https://github.com/JuliaMath/AppleAccelerate.jl), which provides access to macOS's Accelerate framework.
Similar packages are [Yeppp.jl](https://github.com/JuliaMath/Yeppp.jl), which wraps the open-source Yeppp library, and [AppleAccelerate.jl](https://github.com/JuliaMath/AppleAccelerate.jl), which provides access to macOS's Accelerate framework.

### Warning for macOS
There is currently [the following](https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/700) issue between the `CompilerSupportLibraries_jll` artifact, which is used for example by `SpecialFunctions.jl`, and `MKL_jll`. Unless `MKL_jll` is loaded first, there might be wrong results coming from a small number of function for particular input array lengths. If you are unsure which, if any, your used packages might load this artifact, loading `IntelVectorMath` as the very first package should be fine.
Expand All @@ -33,11 +33,11 @@ julia> ] build IntelVectorMath
If this does not work, please open an issue and include the output of `<packagedir>/deps/build.log`.

#### Renaming from VML
If you used this package prior to its renaming, you may have to run `] rm VML` first. Otherwise there will be a conflict due to the UUID.
If you used this package prior to its renaming, you may have to run `] rm VML` first. Otherwise, there will be a conflict due to the UUID.

## Using IntelVectorMath
After loading `IntelVectorMath`, you have the supported function listed below, for example `IntelVectorMath.sin(rand(100))`. These should provide a significant speed-up over broadcasting the Base functions.
Since the package name is quite long, an alias `IVM` is also exported to allow `IVM.sin(rand(100))` after `using` the package.
As the package name is quite long, the alias `IVM` is also exported to allow `IVM.sin(rand(100))` after `using` the package.
If you `import` the package, you can add this alias via `const IVM = IntelVectorMath`. Equally, you can replace `IVM` with another alias of your choice.

#### Example
Expand Down Expand Up @@ -216,7 +216,7 @@ Allocating | Mutating

### Binary functions

Allocating forms have signature `f(A, B)`. Mutating forms have
Allocating forms have signature `f(A, B)`. Mutating forms have the
signature `f!(out, A, B)`.

Allocating | Mutating
Expand All @@ -240,7 +240,7 @@ Next steps for this package
* [x] Add tests for mutating functions
* [x] Add own dependency management via BinaryProvider
* [ ] Update function list in README
* [ ] Adopt Julia 1.3 artifact system, breaking backwards compatibility
* [x] Adopt Julia 1.3 artifact system, breaking backwards compatibility



Expand Down
1 change: 1 addition & 0 deletions src/IntelVectorMath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ unary_real = (
(:inv_sqrt, :inv_sqrt!, :InvSqrt),
(:pow2o3, :pow2o3!, :Pow2o3),
(:pow3o2, :pow3o2!, :Pow3o2),
(:cdfnorm, :cdfnorm!, :CdfNorm),
)

binary_real = (
Expand Down
1 change: 1 addition & 0 deletions test/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const base_unary_real = (
(Main, :inv_cbrt, (0, 1000)),
(Main, :pow2o3, (-1000, 1000)),
(Main, :pow3o2, (0, 1000)),
(Main, :cdfnorm, (-4, 4)),
)

const base_binary_real = (
Expand Down
3 changes: 3 additions & 0 deletions test/nonbase-functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ pow(x, y) = x^y
# divide
divide(x, y) = x / y

# cdfnorm
cdfnorm(x) = 0.5 * (1 + SpecialFunctions.erf(x / sqrt(2)))

# :lgamma
# Redefining for testing to avoid deprecation warning
SpecialFunctions.lgamma(x::Union{Float64,Float32}) = (logabsgamma(x))[1]
Expand Down