You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .travis.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,6 @@ before_script:
24
24
25
25
script:
26
26
#
27
-
- export JL_PKG=VML
28
-
- julia --color=yes -e "if VERSION < v\"0.7.0-DEV.5183\"; Pkg.clone(pwd()); Pkg.build(\"VML\"); else using Pkg; if VERSION >= v\"1.1.0-rc1\"; Pkg.build(\"VML\"; verbose=true); else Pkg.build(\"VML\"); end; end"
29
-
- julia --check-bounds=yes --color=yes -e "if VERSION < v\"0.7.0-DEV.5183\"; Pkg.test(\"VML\", coverage=true); else using Pkg; Pkg.test(coverage=true); end"
27
+
- export JL_PKG=IntelVectorMath
28
+
- julia --color=yes -e "if VERSION < v\"0.7.0-DEV.5183\"; Pkg.clone(pwd()); Pkg.build(\"IntelVectorMath\"); else using Pkg; if VERSION >= v\"1.1.0-rc1\"; Pkg.build(\"IntelVectorMath\"; verbose=true); else Pkg.build(\"IntelVectorMath\"); end; end"
29
+
- julia --check-bounds=yes --color=yes -e "if VERSION < v\"0.7.0-DEV.5183\"; Pkg.test(\"IntelVectorMath\", coverage=true); else using Pkg; Pkg.test(coverage=true); end"
This package provides bindings to the Intel Vector Math Library for
6
-
arithmetic and transcendental functions. Especially for large vectors it is often substantially faster than broadcasting Julia's built-in functions.
5
+
This package provides bindings to the Intel MKL [Vector Mathematics Functions](https://software.intel.com/en-us/node/521751).
6
+
This is often substantially faster than broadcasting Julia's built-in functions, especially when applying a transcendental function over a large array.
7
+
Until Julia 0.6 the package was registered as `VML.jl`.
7
8
8
9
## Basic install
9
10
10
-
To use VML.jl, you must have the shared libraries of the Intel Vector Math Library avilable on your system.
11
-
The easiest option is to use [MKL.jl](https://github.com/JuliaComputing/MKL.jl) via
11
+
To use IntelVectorMath.jl, you must have the shared libraries of the Intel Vector Math Library available on your system.
12
+
The easiest option is to use [MKL.jl](https://github.com/JuliaComputing/MKL.jl) via
Alternatively you can install MKL directly [from intel](https://software.intel.com/en-us/mkl/choose-download).
16
17
17
18
Note that intel MKL has a separate license, which you may want to check for commercial projects (see [FAQ](https://software.intel.com/en-us/mkl/license-faq)).
After loading `VML`, you have the supported function listed below available to call, i.e. `VML.sin(rand(100))`. This should provide a significant speed-up over broadcasting the Base functions.
25
+
## Using IntelVectorMath
26
+
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.
27
+
Since the package name is quite long, an alias `IVM` is also exported to allow `IVM.sin(rand(100))` after `using` the package.
28
+
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.
29
+
30
+
#### Example
26
31
```julia
27
-
julia>usingVML, BenchmarkTools
32
+
julia>usingIntelVectorMath, BenchmarkTools
28
33
29
34
julia> a =randn(10^4);
30
35
31
36
julia>@btimesin.($a); # apply Base.sin to each element
32
37
102.128 μs (2 allocations:78.20 KiB)
33
38
34
-
julia>@btimeVML.sin($a); # apply VML.sin to the whole array
39
+
julia>@btimeIVM.sin($a); # apply IVM.sin to the whole array
35
40
20.900 μs (2 allocations:78.20 KiB)
36
41
37
42
julia> b =similar(a);
38
43
39
-
julia>@btimeVML.sin!(b, a); # in-place version
44
+
julia>@btimeIVM.sin!(b, a); # in-place version
40
45
20.008 μs (0 allocations:0 bytes)
41
46
```
42
47
@@ -50,7 +55,7 @@ julia> @btime sin($a);
50
55
julia> ans ≈sin.(a)
51
56
true
52
57
```
53
-
Calling `sin` on an array now calls the a VML function, while its action on scalars is unchanged.
58
+
Calling `sin` on an array now calls the a IntelVectorMath function, while its action on scalars is unchanged.
54
59
55
60
#### Note:
56
61
@@ -61,47 +66,47 @@ julia> exp(ones(2,2))
61
66
4.194533.19453
62
67
3.194534.19453
63
68
64
-
julia>VML.exp(ones(2,2))
69
+
julia>IVM.exp(ones(2,2))
65
70
2×2 Array{Float64,2}:
66
71
2.718282.71828
67
72
2.718282.71828
68
73
69
74
julia> ans ==exp.(ones(2,2))
70
75
true
71
76
```
72
-
If your code, or any code you call, uses matrix exponentiation, then `@overload exp` may silently lead to incorrect results. This caution applies to all trigonometric functions, too, since they have matrix forms defined by matrix exponential.
77
+
If your code, or any code you call, uses matrix exponentiation, then `@overload exp` may silently lead to incorrect results. This caution applies to all trigonometric functions, too, since they have matrix forms defined by matrix exponentials.
73
78
74
79
### Accuracy
75
80
76
-
By default, VML uses `VML_HA` mode, which corresponds to an accuracy of
81
+
By default, IntelVectorMath uses `VML_HA` mode, which corresponds to an accuracy of
77
82
<1 ulp, matching the accuracy of Julia's built-in openlibm
78
83
implementation, although the exact results may be different. To specify
79
84
low accuracy, use `vml_set_accuracy(VML_LA)`. To specify enhanced
80
85
performance, use `vml_set_accuracy(VML_EP)`. More documentation
Tests were performed on an Intel(R) Core(TM) i7-3930K CPU. Error bars
91
96
are 95% confidence intervals based on 25 repetitions of each test with
92
97
a 1,000,000 element vector. The dashed line indicates equivalent
93
-
performance for VML versus the implementations in Base. Both Base and
94
-
VML use only a single core when performing these benchmarks.
98
+
performance for IntelVectorMath versus the implementations in Base. Both Base and
99
+
IntelVectorMath use only a single core when performing these benchmarks.
95
100
96
101
## Supported functions
97
102
98
-
VML.jl supports the following functions, most for Float32 and
103
+
IntelVectorMath.jl supports the following functions, most for Float32 and
99
104
Float64, while some also take complex numbers.
100
105
101
106
### Unary functions
102
107
103
108
Allocating forms have signature `f(A)`. Mutating forms have signatures
104
-
`f!(A)` (in place) and `f!(out, A)` (out of place). The last 9 functions have been moved from Base to `SpecialFunctions.jl` or have no Base equivalent.
109
+
`f!(A)` (in place) and `f!(out, A)` (out of place). The last 9 functions have been moved from Base to `SpecialFunctions.jl` or have no Base equivalent.
105
110
106
111
Allocating | Mutating
107
112
-----------|---------
@@ -143,7 +148,7 @@ Allocating | Mutating
143
148
### Binary functions
144
149
145
150
Allocating forms have signature `f(A, B)`. Mutating forms have
146
-
signature `f!(out, A, B)`.
151
+
signature `f!(out, A, B)`.
147
152
148
153
Allocating | Mutating
149
154
-----------|---------
@@ -154,21 +159,21 @@ Allocating | Mutating
154
159
155
160
156
161
## Next steps
157
-
Next steps for this package
162
+
Next steps for this package
158
163
*[x] Windows support
159
164
*[x] Basic Testing
160
165
*[x] Avoiding overloading base and optional overload function
161
-
*[ ] Updating Benchmarks
162
166
*[x] Travis and AppVeyor testing
163
167
*[x] Adding CIS function
168
+
*[ ] Updating Benchmarks
164
169
*[ ] Add tests for mutating functions
170
+
*[ ] Add test for using standalone MKL
165
171
166
172
173
+
## Advanced
174
+
IntelVectorMath.jl works via Libdl which loads the relevant shared libraries. Libdl automatically finds the relevant libraries if the location of the binaries has been added to the system search paths.
175
+
This already taken care of if you use MKL.jl, but the stand-alone may require you to source `mklvars.sh`. The default command on Mac and Ubuntu is `source /opt/intel/mkl/bin/mklvars.sh intel64`. You may want to add this to your `.bashrc`.
176
+
Adding a new `*.conf` file in `/etc/ld.so.conf.d` also works, as the `intel-mkl-slim` package in the AUR does automatically.
167
177
168
-
## Advanced
169
-
VML.jl works via Libdl which loads the relevant shared libraries. Libdl automatically finds the relevant libraries if the location of the binaries has been added to the system search paths.
170
-
This already taken care of if you use MKL.jl, but the stand-alone may require you to source `mklvars.sh`. The default command on Mac and Ubuntu is `source /opt/intel/mkl/bin/mklvars.sh intel64`. You may want to add this to your `.bashrc`.
171
-
Adding a new `*.conf` file in `/etc/ld.so.conf.d` also works, as the `intel-mkl-slim` package in the AUR does automatically.
172
-
173
-
Further, VML.jl uses [CpuId.jl](https://github.com/m-j-w/CpuId.jl) to detect if your processor supports the newer `avx2` instructions, and if not defaults to `libmkl_vml_avx`. If your system does not have AVX this package will currently not work for you.
174
-
If the CPU feature detection does not work for you, please open an issue.
178
+
Further, IntelVectorMath.jl uses [CpuId.jl](https://github.com/m-j-w/CpuId.jl) to detect if your processor supports the newer `avx2` instructions, and if not defaults to `libmkl_vml_avx`. If your system does not have AVX this package will currently not work for you.
179
+
If the CPU feature detection does not work for you, please open an issue.
Copy file name to clipboardExpand all lines: benchmark/benchmark.jl
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
usingVML
1
+
usingIntelVectorMath
2
2
using Distributions, Statistics, BenchmarkTools # for benchmark
3
3
using Plots # for plotting
4
4
using JLD2, FileIO # to save file
@@ -32,7 +32,7 @@ fns = [[x[1:2] for x in base_unary_real];
32
32
"""
33
33
bench(fns, input)
34
34
35
-
benchmark function for VML.jl. Calls both Base and VML functions and stores the benchmarks in two nested Dict. First layer specifies type, and second layer specifies the function name. The result is a Tuple, 1st element being benchmark for Base/SpecialFunctions and 2nd element being for VML.
35
+
benchmark function for IntelVectorMath.jl. Calls both Base and IntelVectorMath functions and stores the benchmarks in two nested Dict. First layer specifies type, and second layer specifies the function name. The result is a Tuple, 1st element being benchmark for Base/SpecialFunctions and 2nd element being for IntelVectorMath.
0 commit comments