PyDistance is a set of distance measure implementations optimized for a variety of processors with SIMD support able to be used from Python.
CMake
>= 3.10
AVX Instruction Set | SIMD_WIDTH option |
---|---|
Auto Vectorization | auto |
AVX-128 | 128 |
AVX-256 | 256 |
AVX-512 | 512 |
The setting SIMD_WIDTH
may be specified to take full advantage of the target architecture, as follows:
$ mkdir build
$ cd build
$ cmake .. [-D SIMD_WIDTH=<auto|128|256|512>]
$ make
$ cd lib
>>> import PyDistance as pd
>>> import numpy as np
>>> a=np.random.randint(0, 10, 8)
>>> a
array([4, 3, 5, 1, 4, 5, 7, 7])
>>> b=np.random.randint(0, 10, 8)
>>> b
array([1, 3, 3, 4, 1, 4, 3, 6])
>>> pd.euclidean(a,b)
7.0
PyDistance is a research project and for now, we are a small team! We actively encourage and support contributions. The source code is released under the GNU License.