diff options
author | Otakar Jašek | 2020-09-06 17:37:30 +0200 |
---|---|---|
committer | Otakar Jašek | 2020-09-06 17:37:30 +0200 |
commit | ed83253b98b177b73a22dd288b208eaef8107a92 (patch) | |
tree | f8d24e78bbb27142adacb4924dea5ff320fed4aa | |
parent | 1a568a2b0b43bc203e48bb1d99d6c0aec6d675ba (diff) | |
download | aur-ed83253b98b177b73a22dd288b208eaef8107a92.tar.gz |
tests
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 28 | ||||
-rw-r--r-- | tests.patch | 13 |
3 files changed, 39 insertions, 6 deletions
@@ -1,5 +1,5 @@ pkgbase = faiss-cuda-git - pkgver = 1.6.1.r87.gc97f890 + pkgver = 1.6.1.r90.g9873376 pkgrel = 1 url = https://github.com/facebookresearch/faiss arch = i686 @@ -18,8 +18,10 @@ pkgbase = faiss-cuda-git optdepends = intel-mkl source = faiss::git+https://github.com/facebookresearch/faiss.git source = compiler.patch + source = tests.patch sha256sums = SKIP sha256sums = 3739947d39ebffb2775607f135743cd30489aa12f41c14e3aec42fbe79822fd3 + sha256sums = 0e90164da283d87b2ad176449b1ba441b7ce0c6343aa4dbb8d268483bf805ccd pkgname = faiss-cuda-git pkgdesc = A library for efficient similarity search and clustering of dense vectors, CUDA version. @@ -8,12 +8,14 @@ pkgname=('faiss-cuda-git' 'python-faiss-cuda-git') arch=('i686' 'x86_64') url="https://github.com/facebookresearch/faiss" license=('MIT') -pkgver=1.6.1.r87.gc97f890 +pkgver=1.6.1.r90.g9873376 pkgrel=1 source=(${_pkgname}::git+https://github.com/facebookresearch/faiss.git - 'compiler.patch') + 'compiler.patch' + 'tests.patch') sha256sums=('SKIP' - '3739947d39ebffb2775607f135743cd30489aa12f41c14e3aec42fbe79822fd3') + '3739947d39ebffb2775607f135743cd30489aa12f41c14e3aec42fbe79822fd3' + '0e90164da283d87b2ad176449b1ba441b7ce0c6343aa4dbb8d268483bf805ccd') depends=('blas' 'lapack' 'cuda' 'openmp') makedepends=('git' 'python' 'python-numpy' 'swig' 'python-setuptools' 'gcc9') optdepends=('intel-mkl') @@ -27,19 +29,35 @@ pkgver() { prepare() { cd "${srcdir}/${_pkgname}" - patch -p1 < ../compiler.patch + patch -p1 < ../compiler.patch # see https://github.com/facebookresearch/faiss/issues/1392 + patch -p1 < ../tests.patch # see https://github.com/facebookresearch/faiss/issues/1394 mkdir -p build cd build - _CMAKE_FLAGS="-DFAISS_ENABLE_GPU=ON -DFAISS_ENABLE_PYTHON=ON -DCUDAToolkit_ROOT=/opt/cuda -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr " + _CMAKE_FLAGS="\ + -DFAISS_ENABLE_GPU=ON \ + -DFAISS_ENABLE_PYTHON=ON \ + -DCUDAToolkit_ROOT=/opt/cuda \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=/usr " if ! [ -z "$_GPU_TARGET" ] then _CMAKE_FLAGS=$_CMAKE_FLAGS"-DCMAKE_CUDA_ARCHITECTURES=\""$_GPU_TARGET"\"" else _CMAKE_FLAGS=$_CMAKE_FLAGS"-DCMAKE_CUDA_ARCHITECTURES=\"\"52 60 61 70 75\"\"" fi + echo $_CMAKE_FLAGS cmake $_CMAKE_FLAGS .. } +check() { + cd "${srcdir}/${_pkgname}/build" + make test + cd "${srcdir}/${_pkgname}/tests" + PYTHONPATH=../build/faiss/python:$PYTHONPATH pytest +} + + build() { cd "${srcdir}/${_pkgname}/build" diff --git a/tests.patch b/tests.patch new file mode 100644 index 000000000000..49a259a10c06 --- /dev/null +++ b/tests.patch @@ -0,0 +1,13 @@ +diff --git a/tests/test_contrib.py b/tests/test_contrib.py +index 87155e9..ad9f64a 100644 +--- a/tests/test_contrib.py ++++ b/tests/test_contrib.py +@@ -32,7 +32,7 @@ class TestComputeGT(unittest.TestCase): + Dnew, Inew = knn_ground_truth(xq, matrix_iterator(xb, 1000), 10) + + np.testing.assert_array_equal(Iref, Inew) +- np.testing.assert_almost_equal(Dref, Dnew, decimal=5) ++ np.testing.assert_almost_equal(Dref, Dnew, decimal=4) + + + class TestDatasets(unittest.TestCase): |