From 750d43f7f110c5d18841879c04b346e0a1767d08 Mon Sep 17 00:00:00 2001 From: Lucas Hosseini Date: Tue, 4 Aug 2020 17:16:58 +0200 Subject: [PATCH] Move source code to faiss/ subdirectory. (#1312) * Move source code to faiss/ subdirectory. * Remove stale files. --- .travis.yml | 2 +- Makefile | 21 +++-- configure | 2 +- configure.ac | 2 +- faiss | 1 - AutoTune.cpp => faiss/AutoTune.cpp | 0 AutoTune.h => faiss/AutoTune.h | 0 Clustering.cpp => faiss/Clustering.cpp | 0 Clustering.h => faiss/Clustering.h | 0 DirectMap.cpp => faiss/DirectMap.cpp | 0 DirectMap.h => faiss/DirectMap.h | 0 IVFlib.cpp => faiss/IVFlib.cpp | 0 IVFlib.h => faiss/IVFlib.h | 0 Index.cpp => faiss/Index.cpp | 0 Index.h => faiss/Index.h | 0 Index2Layer.cpp => faiss/Index2Layer.cpp | 0 Index2Layer.h => faiss/Index2Layer.h | 0 IndexBinary.cpp => faiss/IndexBinary.cpp | 0 IndexBinary.h => faiss/IndexBinary.h | 0 .../IndexBinaryFlat.cpp | 0 IndexBinaryFlat.h => faiss/IndexBinaryFlat.h | 0 .../IndexBinaryFromFloat.cpp | 0 .../IndexBinaryFromFloat.h | 0 .../IndexBinaryHNSW.cpp | 0 IndexBinaryHNSW.h => faiss/IndexBinaryHNSW.h | 0 .../IndexBinaryHash.cpp | 0 IndexBinaryHash.h => faiss/IndexBinaryHash.h | 0 .../IndexBinaryIVF.cpp | 0 IndexBinaryIVF.h => faiss/IndexBinaryIVF.h | 0 IndexFlat.cpp => faiss/IndexFlat.cpp | 0 IndexFlat.h => faiss/IndexFlat.h | 0 IndexHNSW.cpp => faiss/IndexHNSW.cpp | 0 IndexHNSW.h => faiss/IndexHNSW.h | 0 IndexIVF.cpp => faiss/IndexIVF.cpp | 0 IndexIVF.h => faiss/IndexIVF.h | 0 IndexIVFFlat.cpp => faiss/IndexIVFFlat.cpp | 0 IndexIVFFlat.h => faiss/IndexIVFFlat.h | 0 IndexIVFPQ.cpp => faiss/IndexIVFPQ.cpp | 0 IndexIVFPQ.h => faiss/IndexIVFPQ.h | 0 IndexIVFPQR.cpp => faiss/IndexIVFPQR.cpp | 0 IndexIVFPQR.h => faiss/IndexIVFPQR.h | 0 .../IndexIVFSpectralHash.cpp | 0 .../IndexIVFSpectralHash.h | 0 IndexLSH.cpp => faiss/IndexLSH.cpp | 0 IndexLSH.h => faiss/IndexLSH.h | 0 IndexLattice.cpp => faiss/IndexLattice.cpp | 0 IndexLattice.h => faiss/IndexLattice.h | 0 IndexPQ.cpp => faiss/IndexPQ.cpp | 0 IndexPQ.h => faiss/IndexPQ.h | 0 .../IndexPreTransform.cpp | 0 .../IndexPreTransform.h | 0 IndexReplicas.cpp => faiss/IndexReplicas.cpp | 0 IndexReplicas.h => faiss/IndexReplicas.h | 0 .../IndexScalarQuantizer.cpp | 0 .../IndexScalarQuantizer.h | 0 IndexShards.cpp => faiss/IndexShards.cpp | 0 IndexShards.h => faiss/IndexShards.h | 0 InvertedLists.cpp => faiss/InvertedLists.cpp | 0 InvertedLists.h => faiss/InvertedLists.h | 0 MatrixStats.cpp => faiss/MatrixStats.cpp | 0 MatrixStats.h => faiss/MatrixStats.h | 0 MetaIndexes.cpp => faiss/MetaIndexes.cpp | 0 MetaIndexes.h => faiss/MetaIndexes.h | 0 MetricType.h => faiss/MetricType.h | 0 .../OnDiskInvertedLists.cpp | 0 .../OnDiskInvertedLists.h | 0 .../VectorTransform.cpp | 0 VectorTransform.h => faiss/VectorTransform.h | 0 clone_index.cpp => faiss/clone_index.cpp | 0 clone_index.h => faiss/clone_index.h | 0 {gpu => faiss/gpu}/GpuAutoTune.cpp | 0 {gpu => faiss/gpu}/GpuAutoTune.h | 0 {gpu => faiss/gpu}/GpuCloner.cpp | 0 {gpu => faiss/gpu}/GpuCloner.h | 0 {gpu => faiss/gpu}/GpuClonerOptions.cpp | 0 {gpu => faiss/gpu}/GpuClonerOptions.h | 0 {gpu => faiss/gpu}/GpuDistance.cu | 0 {gpu => faiss/gpu}/GpuDistance.h | 0 {gpu => faiss/gpu}/GpuFaissAssert.h | 0 {gpu => faiss/gpu}/GpuIndex.cu | 0 {gpu => faiss/gpu}/GpuIndex.h | 0 {gpu => faiss/gpu}/GpuIndexBinaryFlat.cu | 0 {gpu => faiss/gpu}/GpuIndexBinaryFlat.h | 0 {gpu => faiss/gpu}/GpuIndexFlat.cu | 0 {gpu => faiss/gpu}/GpuIndexFlat.h | 0 {gpu => faiss/gpu}/GpuIndexIVF.cu | 0 {gpu => faiss/gpu}/GpuIndexIVF.h | 0 {gpu => faiss/gpu}/GpuIndexIVFFlat.cu | 0 {gpu => faiss/gpu}/GpuIndexIVFFlat.h | 0 {gpu => faiss/gpu}/GpuIndexIVFPQ.cu | 0 {gpu => faiss/gpu}/GpuIndexIVFPQ.h | 0 .../gpu}/GpuIndexIVFScalarQuantizer.cu | 0 .../gpu}/GpuIndexIVFScalarQuantizer.h | 0 {gpu => faiss/gpu}/GpuIndicesOptions.h | 0 {gpu => faiss/gpu}/GpuResources.cpp | 0 {gpu => faiss/gpu}/GpuResources.h | 0 {gpu => faiss/gpu}/StandardGpuResources.cpp | 0 {gpu => faiss/gpu}/StandardGpuResources.h | 0 {gpu => faiss/gpu}/impl/BinaryDistance.cu | 0 {gpu => faiss/gpu}/impl/BinaryDistance.cuh | 0 {gpu => faiss/gpu}/impl/BinaryFlatIndex.cu | 0 {gpu => faiss/gpu}/impl/BinaryFlatIndex.cuh | 0 {gpu => faiss/gpu}/impl/BroadcastSum.cu | 0 {gpu => faiss/gpu}/impl/BroadcastSum.cuh | 0 {gpu => faiss/gpu}/impl/Distance.cu | 0 {gpu => faiss/gpu}/impl/Distance.cuh | 0 {gpu => faiss/gpu}/impl/DistanceUtils.cuh | 0 {gpu => faiss/gpu}/impl/FlatIndex.cu | 0 {gpu => faiss/gpu}/impl/FlatIndex.cuh | 0 {gpu => faiss/gpu}/impl/GeneralDistance.cuh | 0 .../gpu}/impl/GpuScalarQuantizer.cuh | 0 {gpu => faiss/gpu}/impl/IVFAppend.cu | 0 {gpu => faiss/gpu}/impl/IVFAppend.cuh | 0 {gpu => faiss/gpu}/impl/IVFBase.cu | 0 {gpu => faiss/gpu}/impl/IVFBase.cuh | 0 {gpu => faiss/gpu}/impl/IVFFlat.cu | 0 {gpu => faiss/gpu}/impl/IVFFlat.cuh | 0 {gpu => faiss/gpu}/impl/IVFFlatScan.cu | 0 {gpu => faiss/gpu}/impl/IVFFlatScan.cuh | 0 {gpu => faiss/gpu}/impl/IVFPQ.cu | 0 {gpu => faiss/gpu}/impl/IVFPQ.cuh | 0 {gpu => faiss/gpu}/impl/IVFUtils.cu | 0 {gpu => faiss/gpu}/impl/IVFUtils.cuh | 0 {gpu => faiss/gpu}/impl/IVFUtilsSelect1.cu | 0 {gpu => faiss/gpu}/impl/IVFUtilsSelect2.cu | 0 {gpu => faiss/gpu}/impl/L2Norm.cu | 0 {gpu => faiss/gpu}/impl/L2Norm.cuh | 0 {gpu => faiss/gpu}/impl/L2Select.cu | 0 {gpu => faiss/gpu}/impl/L2Select.cuh | 0 .../gpu}/impl/PQCodeDistances-inl.cuh | 0 {gpu => faiss/gpu}/impl/PQCodeDistances.cuh | 0 {gpu => faiss/gpu}/impl/PQCodeLoad.cuh | 0 .../impl/PQScanMultiPassNoPrecomputed-inl.cuh | 0 .../impl/PQScanMultiPassNoPrecomputed.cuh | 0 .../gpu}/impl/PQScanMultiPassPrecomputed.cu | 0 .../gpu}/impl/PQScanMultiPassPrecomputed.cuh | 0 {gpu => faiss/gpu}/impl/RemapIndices.cpp | 0 {gpu => faiss/gpu}/impl/RemapIndices.h | 0 {gpu => faiss/gpu}/impl/VectorResidual.cu | 0 {gpu => faiss/gpu}/impl/VectorResidual.cuh | 0 {gpu => faiss/gpu}/perf/IndexWrapper-inl.h | 0 {gpu => faiss/gpu}/perf/IndexWrapper.h | 0 {gpu => faiss/gpu}/perf/PerfBinaryFlat.cu | 0 {gpu => faiss/gpu}/perf/PerfClustering.cpp | 0 {gpu => faiss/gpu}/perf/PerfFlat.cu | 0 {gpu => faiss/gpu}/perf/PerfIVFFlat.cu | 0 {gpu => faiss/gpu}/perf/PerfIVFPQ.cu | 0 {gpu => faiss/gpu}/perf/PerfIVFPQAdd.cpp | 0 {gpu => faiss/gpu}/perf/PerfSelect.cu | 0 {gpu => faiss/gpu}/perf/WriteIndex.cpp | 0 {gpu => faiss/gpu}/perf/slow.py | 0 {gpu => faiss/gpu}/test/Makefile | 0 {gpu => faiss/gpu}/test/TestGpuDistance.cu | 0 .../gpu}/test/TestGpuIndexBinaryFlat.cpp | 0 {gpu => faiss/gpu}/test/TestGpuIndexFlat.cpp | 0 .../gpu}/test/TestGpuIndexIVFFlat.cpp | 0 {gpu => faiss/gpu}/test/TestGpuIndexIVFPQ.cpp | 0 .../gpu}/test/TestGpuMemoryException.cpp | 0 {gpu => faiss/gpu}/test/TestGpuSelect.cu | 0 {gpu => faiss/gpu}/test/TestUtils.cpp | 0 {gpu => faiss/gpu}/test/TestUtils.h | 0 .../gpu}/test/demo_ivfpq_indexing_gpu.cpp | 0 {gpu => faiss/gpu}/test/test_gpu_index.py | 0 .../gpu}/test/test_gpu_index_ivfsq.py | 0 {gpu => faiss/gpu}/test/test_pytorch_faiss.py | 0 {gpu => faiss/gpu}/utils/BlockSelectFloat.cu | 0 {gpu => faiss/gpu}/utils/BlockSelectHalf.cu | 0 .../gpu}/utils/BlockSelectKernel.cuh | 0 {gpu => faiss/gpu}/utils/Comparators.cuh | 0 .../gpu}/utils/ConversionOperators.cuh | 0 {gpu => faiss/gpu}/utils/CopyUtils.cuh | 0 {gpu => faiss/gpu}/utils/DeviceDefs.cuh | 0 {gpu => faiss/gpu}/utils/DeviceTensor-inl.cuh | 0 {gpu => faiss/gpu}/utils/DeviceTensor.cuh | 0 {gpu => faiss/gpu}/utils/DeviceUtils.cu | 0 {gpu => faiss/gpu}/utils/DeviceUtils.h | 0 {gpu => faiss/gpu}/utils/DeviceVector.cuh | 0 {gpu => faiss/gpu}/utils/Float16.cu | 0 {gpu => faiss/gpu}/utils/Float16.cuh | 0 {gpu => faiss/gpu}/utils/HostTensor-inl.cuh | 0 {gpu => faiss/gpu}/utils/HostTensor.cuh | 0 {gpu => faiss/gpu}/utils/Limits.cuh | 0 .../gpu}/utils/LoadStoreOperators.cuh | 0 {gpu => faiss/gpu}/utils/MathOperators.cuh | 0 {gpu => faiss/gpu}/utils/MatrixMult-inl.cuh | 0 {gpu => faiss/gpu}/utils/MatrixMult.cu | 0 {gpu => faiss/gpu}/utils/MatrixMult.cuh | 0 .../gpu}/utils/MergeNetworkBlock.cuh | 0 .../gpu}/utils/MergeNetworkUtils.cuh | 0 {gpu => faiss/gpu}/utils/MergeNetworkWarp.cuh | 0 {gpu => faiss/gpu}/utils/NoTypeTensor.cuh | 0 {gpu => faiss/gpu}/utils/Pair.cuh | 0 {gpu => faiss/gpu}/utils/PtxUtils.cuh | 0 .../gpu}/utils/ReductionOperators.cuh | 0 {gpu => faiss/gpu}/utils/Reductions.cuh | 0 {gpu => faiss/gpu}/utils/Select.cuh | 0 .../gpu}/utils/StackDeviceMemory.cpp | 0 {gpu => faiss/gpu}/utils/StackDeviceMemory.h | 0 {gpu => faiss/gpu}/utils/StaticUtils.h | 0 {gpu => faiss/gpu}/utils/Tensor-inl.cuh | 0 {gpu => faiss/gpu}/utils/Tensor.cuh | 0 {gpu => faiss/gpu}/utils/ThrustAllocator.cuh | 0 {gpu => faiss/gpu}/utils/Timer.cpp | 0 {gpu => faiss/gpu}/utils/Timer.h | 0 {gpu => faiss/gpu}/utils/Transpose.cuh | 0 {gpu => faiss/gpu}/utils/WarpSelectFloat.cu | 0 {gpu => faiss/gpu}/utils/WarpSelectHalf.cu | 0 {gpu => faiss/gpu}/utils/WarpSelectKernel.cuh | 0 {gpu => faiss/gpu}/utils/WarpShuffles.cuh | 0 .../utils/blockselect/BlockSelectFloat1.cu | 0 .../utils/blockselect/BlockSelectFloat128.cu | 0 .../utils/blockselect/BlockSelectFloat256.cu | 0 .../utils/blockselect/BlockSelectFloat32.cu | 0 .../utils/blockselect/BlockSelectFloat64.cu | 0 .../blockselect/BlockSelectFloatF1024.cu | 0 .../blockselect/BlockSelectFloatF2048.cu | 0 .../utils/blockselect/BlockSelectFloatF512.cu | 0 .../blockselect/BlockSelectFloatT1024.cu | 0 .../blockselect/BlockSelectFloatT2048.cu | 0 .../utils/blockselect/BlockSelectFloatT512.cu | 0 .../utils/blockselect/BlockSelectHalf1.cu | 0 .../utils/blockselect/BlockSelectHalf128.cu | 0 .../utils/blockselect/BlockSelectHalf256.cu | 0 .../utils/blockselect/BlockSelectHalf32.cu | 0 .../utils/blockselect/BlockSelectHalf64.cu | 0 .../utils/blockselect/BlockSelectHalfF1024.cu | 0 .../utils/blockselect/BlockSelectHalfF2048.cu | 0 .../utils/blockselect/BlockSelectHalfF512.cu | 0 .../utils/blockselect/BlockSelectHalfT1024.cu | 0 .../utils/blockselect/BlockSelectHalfT2048.cu | 0 .../utils/blockselect/BlockSelectHalfT512.cu | 0 .../utils/blockselect/BlockSelectImpl.cuh | 0 {gpu => faiss/gpu}/utils/nvidia/fp16_emu.cu | 0 {gpu => faiss/gpu}/utils/nvidia/fp16_emu.cuh | 0 .../gpu}/utils/warpselect/WarpSelectFloat1.cu | 0 .../utils/warpselect/WarpSelectFloat128.cu | 0 .../utils/warpselect/WarpSelectFloat256.cu | 0 .../utils/warpselect/WarpSelectFloat32.cu | 0 .../utils/warpselect/WarpSelectFloat64.cu | 0 .../utils/warpselect/WarpSelectFloatF1024.cu | 0 .../utils/warpselect/WarpSelectFloatF2048.cu | 0 .../utils/warpselect/WarpSelectFloatF512.cu | 0 .../utils/warpselect/WarpSelectFloatT1024.cu | 0 .../utils/warpselect/WarpSelectFloatT2048.cu | 0 .../utils/warpselect/WarpSelectFloatT512.cu | 0 .../gpu}/utils/warpselect/WarpSelectHalf1.cu | 0 .../utils/warpselect/WarpSelectHalf128.cu | 0 .../utils/warpselect/WarpSelectHalf256.cu | 0 .../gpu}/utils/warpselect/WarpSelectHalf32.cu | 0 .../gpu}/utils/warpselect/WarpSelectHalf64.cu | 0 .../utils/warpselect/WarpSelectHalfF1024.cu | 0 .../utils/warpselect/WarpSelectHalfF2048.cu | 0 .../utils/warpselect/WarpSelectHalfF512.cu | 0 .../utils/warpselect/WarpSelectHalfT1024.cu | 0 .../utils/warpselect/WarpSelectHalfT2048.cu | 0 .../utils/warpselect/WarpSelectHalfT512.cu | 0 .../gpu}/utils/warpselect/WarpSelectImpl.cuh | 0 {impl => faiss/impl}/AuxIndexStructures.cpp | 0 {impl => faiss/impl}/AuxIndexStructures.h | 0 {impl => faiss/impl}/FaissAssert.h | 0 {impl => faiss/impl}/FaissException.cpp | 0 {impl => faiss/impl}/FaissException.h | 0 {impl => faiss/impl}/HNSW.cpp | 0 {impl => faiss/impl}/HNSW.h | 0 {impl => faiss/impl}/PolysemousTraining.cpp | 0 {impl => faiss/impl}/PolysemousTraining.h | 0 {impl => faiss/impl}/ProductQuantizer-inl.h | 0 {impl => faiss/impl}/ProductQuantizer.cpp | 0 {impl => faiss/impl}/ProductQuantizer.h | 0 {impl => faiss/impl}/ScalarQuantizer.cpp | 0 {impl => faiss/impl}/ScalarQuantizer.h | 0 {impl => faiss/impl}/ThreadedIndex-inl.h | 0 {impl => faiss/impl}/ThreadedIndex.h | 0 {impl => faiss/impl}/index_read.cpp | 0 {impl => faiss/impl}/index_write.cpp | 0 {impl => faiss/impl}/io.cpp | 0 {impl => faiss/impl}/io.h | 0 {impl => faiss/impl}/io_macros.h | 0 {impl => faiss/impl}/lattice_Zn.cpp | 0 {impl => faiss/impl}/lattice_Zn.h | 0 index_factory.cpp => faiss/index_factory.cpp | 0 index_factory.h => faiss/index_factory.h | 0 index_io.h => faiss/index_io.h | 0 {python => faiss/python}/Makefile | 14 +-- {python => faiss/python}/__init__.py | 0 {python => faiss/python}/loader.py | 0 {python => faiss/python}/python_callbacks.cpp | 0 {python => faiss/python}/python_callbacks.h | 0 {python => faiss/python}/setup.py | 0 {python => faiss/python}/swigfaiss.swig | 0 {utils => faiss/utils}/Heap.cpp | 0 {utils => faiss/utils}/Heap.h | 0 {utils => faiss/utils}/WorkerThread.cpp | 0 {utils => faiss/utils}/WorkerThread.h | 0 {utils => faiss/utils}/distances.cpp | 0 {utils => faiss/utils}/distances.h | 0 {utils => faiss/utils}/distances_simd.cpp | 0 {utils => faiss/utils}/extra_distances.cpp | 0 {utils => faiss/utils}/extra_distances.h | 0 {utils => faiss/utils}/hamming-inl.h | 0 {utils => faiss/utils}/hamming.cpp | 0 {utils => faiss/utils}/hamming.h | 0 {utils => faiss/utils}/random.cpp | 0 {utils => faiss/utils}/random.h | 0 {utils => faiss/utils}/utils.cpp | 0 {utils => faiss/utils}/utils.h | 0 gpu/impl/Metrics.cuh | 52 ----------- gpu/utils/DeviceMemory.cpp | 77 ---------------- gpu/utils/DeviceMemory.h | 71 --------------- gpu/utils/MemorySpace.cpp | 89 ------------------- gpu/utils/MemorySpace.h | 44 --------- 311 files changed, 22 insertions(+), 353 deletions(-) delete mode 120000 faiss rename AutoTune.cpp => faiss/AutoTune.cpp (100%) rename AutoTune.h => faiss/AutoTune.h (100%) rename Clustering.cpp => faiss/Clustering.cpp (100%) rename Clustering.h => faiss/Clustering.h (100%) rename DirectMap.cpp => faiss/DirectMap.cpp (100%) rename DirectMap.h => faiss/DirectMap.h (100%) rename IVFlib.cpp => faiss/IVFlib.cpp (100%) rename IVFlib.h => faiss/IVFlib.h (100%) rename Index.cpp => faiss/Index.cpp (100%) rename Index.h => faiss/Index.h (100%) rename Index2Layer.cpp => faiss/Index2Layer.cpp (100%) rename Index2Layer.h => faiss/Index2Layer.h (100%) rename IndexBinary.cpp => faiss/IndexBinary.cpp (100%) rename IndexBinary.h => faiss/IndexBinary.h (100%) rename IndexBinaryFlat.cpp => faiss/IndexBinaryFlat.cpp (100%) rename IndexBinaryFlat.h => faiss/IndexBinaryFlat.h (100%) rename IndexBinaryFromFloat.cpp => faiss/IndexBinaryFromFloat.cpp (100%) rename IndexBinaryFromFloat.h => faiss/IndexBinaryFromFloat.h (100%) rename IndexBinaryHNSW.cpp => faiss/IndexBinaryHNSW.cpp (100%) rename IndexBinaryHNSW.h => faiss/IndexBinaryHNSW.h (100%) rename IndexBinaryHash.cpp => faiss/IndexBinaryHash.cpp (100%) rename IndexBinaryHash.h => faiss/IndexBinaryHash.h (100%) rename IndexBinaryIVF.cpp => faiss/IndexBinaryIVF.cpp (100%) rename IndexBinaryIVF.h => faiss/IndexBinaryIVF.h (100%) rename IndexFlat.cpp => faiss/IndexFlat.cpp (100%) rename IndexFlat.h => faiss/IndexFlat.h (100%) rename IndexHNSW.cpp => faiss/IndexHNSW.cpp (100%) rename IndexHNSW.h => faiss/IndexHNSW.h (100%) rename IndexIVF.cpp => faiss/IndexIVF.cpp (100%) rename IndexIVF.h => faiss/IndexIVF.h (100%) rename IndexIVFFlat.cpp => faiss/IndexIVFFlat.cpp (100%) rename IndexIVFFlat.h => faiss/IndexIVFFlat.h (100%) rename IndexIVFPQ.cpp => faiss/IndexIVFPQ.cpp (100%) rename IndexIVFPQ.h => faiss/IndexIVFPQ.h (100%) rename IndexIVFPQR.cpp => faiss/IndexIVFPQR.cpp (100%) rename IndexIVFPQR.h => faiss/IndexIVFPQR.h (100%) rename IndexIVFSpectralHash.cpp => faiss/IndexIVFSpectralHash.cpp (100%) rename IndexIVFSpectralHash.h => faiss/IndexIVFSpectralHash.h (100%) rename IndexLSH.cpp => faiss/IndexLSH.cpp (100%) rename IndexLSH.h => faiss/IndexLSH.h (100%) rename IndexLattice.cpp => faiss/IndexLattice.cpp (100%) rename IndexLattice.h => faiss/IndexLattice.h (100%) rename IndexPQ.cpp => faiss/IndexPQ.cpp (100%) rename IndexPQ.h => faiss/IndexPQ.h (100%) rename IndexPreTransform.cpp => faiss/IndexPreTransform.cpp (100%) rename IndexPreTransform.h => faiss/IndexPreTransform.h (100%) rename IndexReplicas.cpp => faiss/IndexReplicas.cpp (100%) rename IndexReplicas.h => faiss/IndexReplicas.h (100%) rename IndexScalarQuantizer.cpp => faiss/IndexScalarQuantizer.cpp (100%) rename IndexScalarQuantizer.h => faiss/IndexScalarQuantizer.h (100%) rename IndexShards.cpp => faiss/IndexShards.cpp (100%) rename IndexShards.h => faiss/IndexShards.h (100%) rename InvertedLists.cpp => faiss/InvertedLists.cpp (100%) rename InvertedLists.h => faiss/InvertedLists.h (100%) rename MatrixStats.cpp => faiss/MatrixStats.cpp (100%) rename MatrixStats.h => faiss/MatrixStats.h (100%) rename MetaIndexes.cpp => faiss/MetaIndexes.cpp (100%) rename MetaIndexes.h => faiss/MetaIndexes.h (100%) rename MetricType.h => faiss/MetricType.h (100%) rename OnDiskInvertedLists.cpp => faiss/OnDiskInvertedLists.cpp (100%) rename OnDiskInvertedLists.h => faiss/OnDiskInvertedLists.h (100%) rename VectorTransform.cpp => faiss/VectorTransform.cpp (100%) rename VectorTransform.h => faiss/VectorTransform.h (100%) rename clone_index.cpp => faiss/clone_index.cpp (100%) rename clone_index.h => faiss/clone_index.h (100%) rename {gpu => faiss/gpu}/GpuAutoTune.cpp (100%) rename {gpu => faiss/gpu}/GpuAutoTune.h (100%) rename {gpu => faiss/gpu}/GpuCloner.cpp (100%) rename {gpu => faiss/gpu}/GpuCloner.h (100%) rename {gpu => faiss/gpu}/GpuClonerOptions.cpp (100%) rename {gpu => faiss/gpu}/GpuClonerOptions.h (100%) rename {gpu => faiss/gpu}/GpuDistance.cu (100%) rename {gpu => faiss/gpu}/GpuDistance.h (100%) rename {gpu => faiss/gpu}/GpuFaissAssert.h (100%) rename {gpu => faiss/gpu}/GpuIndex.cu (100%) rename {gpu => faiss/gpu}/GpuIndex.h (100%) rename {gpu => faiss/gpu}/GpuIndexBinaryFlat.cu (100%) rename {gpu => faiss/gpu}/GpuIndexBinaryFlat.h (100%) rename {gpu => faiss/gpu}/GpuIndexFlat.cu (100%) rename {gpu => faiss/gpu}/GpuIndexFlat.h (100%) rename {gpu => faiss/gpu}/GpuIndexIVF.cu (100%) rename {gpu => faiss/gpu}/GpuIndexIVF.h (100%) rename {gpu => faiss/gpu}/GpuIndexIVFFlat.cu (100%) rename {gpu => faiss/gpu}/GpuIndexIVFFlat.h (100%) rename {gpu => faiss/gpu}/GpuIndexIVFPQ.cu (100%) rename {gpu => faiss/gpu}/GpuIndexIVFPQ.h (100%) rename {gpu => faiss/gpu}/GpuIndexIVFScalarQuantizer.cu (100%) rename {gpu => faiss/gpu}/GpuIndexIVFScalarQuantizer.h (100%) rename {gpu => faiss/gpu}/GpuIndicesOptions.h (100%) rename {gpu => faiss/gpu}/GpuResources.cpp (100%) rename {gpu => faiss/gpu}/GpuResources.h (100%) rename {gpu => faiss/gpu}/StandardGpuResources.cpp (100%) rename {gpu => faiss/gpu}/StandardGpuResources.h (100%) rename {gpu => faiss/gpu}/impl/BinaryDistance.cu (100%) rename {gpu => faiss/gpu}/impl/BinaryDistance.cuh (100%) rename {gpu => faiss/gpu}/impl/BinaryFlatIndex.cu (100%) rename {gpu => faiss/gpu}/impl/BinaryFlatIndex.cuh (100%) rename {gpu => faiss/gpu}/impl/BroadcastSum.cu (100%) rename {gpu => faiss/gpu}/impl/BroadcastSum.cuh (100%) rename {gpu => faiss/gpu}/impl/Distance.cu (100%) rename {gpu => faiss/gpu}/impl/Distance.cuh (100%) rename {gpu => faiss/gpu}/impl/DistanceUtils.cuh (100%) rename {gpu => faiss/gpu}/impl/FlatIndex.cu (100%) rename {gpu => faiss/gpu}/impl/FlatIndex.cuh (100%) rename {gpu => faiss/gpu}/impl/GeneralDistance.cuh (100%) rename {gpu => faiss/gpu}/impl/GpuScalarQuantizer.cuh (100%) rename {gpu => faiss/gpu}/impl/IVFAppend.cu (100%) rename {gpu => faiss/gpu}/impl/IVFAppend.cuh (100%) rename {gpu => faiss/gpu}/impl/IVFBase.cu (100%) rename {gpu => faiss/gpu}/impl/IVFBase.cuh (100%) rename {gpu => faiss/gpu}/impl/IVFFlat.cu (100%) rename {gpu => faiss/gpu}/impl/IVFFlat.cuh (100%) rename {gpu => faiss/gpu}/impl/IVFFlatScan.cu (100%) rename {gpu => faiss/gpu}/impl/IVFFlatScan.cuh (100%) rename {gpu => faiss/gpu}/impl/IVFPQ.cu (100%) rename {gpu => faiss/gpu}/impl/IVFPQ.cuh (100%) rename {gpu => faiss/gpu}/impl/IVFUtils.cu (100%) rename {gpu => faiss/gpu}/impl/IVFUtils.cuh (100%) rename {gpu => faiss/gpu}/impl/IVFUtilsSelect1.cu (100%) rename {gpu => faiss/gpu}/impl/IVFUtilsSelect2.cu (100%) rename {gpu => faiss/gpu}/impl/L2Norm.cu (100%) rename {gpu => faiss/gpu}/impl/L2Norm.cuh (100%) rename {gpu => faiss/gpu}/impl/L2Select.cu (100%) rename {gpu => faiss/gpu}/impl/L2Select.cuh (100%) rename {gpu => faiss/gpu}/impl/PQCodeDistances-inl.cuh (100%) rename {gpu => faiss/gpu}/impl/PQCodeDistances.cuh (100%) rename {gpu => faiss/gpu}/impl/PQCodeLoad.cuh (100%) rename {gpu => faiss/gpu}/impl/PQScanMultiPassNoPrecomputed-inl.cuh (100%) rename {gpu => faiss/gpu}/impl/PQScanMultiPassNoPrecomputed.cuh (100%) rename {gpu => faiss/gpu}/impl/PQScanMultiPassPrecomputed.cu (100%) rename {gpu => faiss/gpu}/impl/PQScanMultiPassPrecomputed.cuh (100%) rename {gpu => faiss/gpu}/impl/RemapIndices.cpp (100%) rename {gpu => faiss/gpu}/impl/RemapIndices.h (100%) rename {gpu => faiss/gpu}/impl/VectorResidual.cu (100%) rename {gpu => faiss/gpu}/impl/VectorResidual.cuh (100%) rename {gpu => faiss/gpu}/perf/IndexWrapper-inl.h (100%) rename {gpu => faiss/gpu}/perf/IndexWrapper.h (100%) rename {gpu => faiss/gpu}/perf/PerfBinaryFlat.cu (100%) rename {gpu => faiss/gpu}/perf/PerfClustering.cpp (100%) rename {gpu => faiss/gpu}/perf/PerfFlat.cu (100%) rename {gpu => faiss/gpu}/perf/PerfIVFFlat.cu (100%) rename {gpu => faiss/gpu}/perf/PerfIVFPQ.cu (100%) rename {gpu => faiss/gpu}/perf/PerfIVFPQAdd.cpp (100%) rename {gpu => faiss/gpu}/perf/PerfSelect.cu (100%) rename {gpu => faiss/gpu}/perf/WriteIndex.cpp (100%) rename {gpu => faiss/gpu}/perf/slow.py (100%) rename {gpu => faiss/gpu}/test/Makefile (100%) rename {gpu => faiss/gpu}/test/TestGpuDistance.cu (100%) rename {gpu => faiss/gpu}/test/TestGpuIndexBinaryFlat.cpp (100%) rename {gpu => faiss/gpu}/test/TestGpuIndexFlat.cpp (100%) rename {gpu => faiss/gpu}/test/TestGpuIndexIVFFlat.cpp (100%) rename {gpu => faiss/gpu}/test/TestGpuIndexIVFPQ.cpp (100%) rename {gpu => faiss/gpu}/test/TestGpuMemoryException.cpp (100%) rename {gpu => faiss/gpu}/test/TestGpuSelect.cu (100%) rename {gpu => faiss/gpu}/test/TestUtils.cpp (100%) rename {gpu => faiss/gpu}/test/TestUtils.h (100%) rename {gpu => faiss/gpu}/test/demo_ivfpq_indexing_gpu.cpp (100%) rename {gpu => faiss/gpu}/test/test_gpu_index.py (100%) rename {gpu => faiss/gpu}/test/test_gpu_index_ivfsq.py (100%) rename {gpu => faiss/gpu}/test/test_pytorch_faiss.py (100%) rename {gpu => faiss/gpu}/utils/BlockSelectFloat.cu (100%) rename {gpu => faiss/gpu}/utils/BlockSelectHalf.cu (100%) rename {gpu => faiss/gpu}/utils/BlockSelectKernel.cuh (100%) rename {gpu => faiss/gpu}/utils/Comparators.cuh (100%) rename {gpu => faiss/gpu}/utils/ConversionOperators.cuh (100%) rename {gpu => faiss/gpu}/utils/CopyUtils.cuh (100%) rename {gpu => faiss/gpu}/utils/DeviceDefs.cuh (100%) rename {gpu => faiss/gpu}/utils/DeviceTensor-inl.cuh (100%) rename {gpu => faiss/gpu}/utils/DeviceTensor.cuh (100%) rename {gpu => faiss/gpu}/utils/DeviceUtils.cu (100%) rename {gpu => faiss/gpu}/utils/DeviceUtils.h (100%) rename {gpu => faiss/gpu}/utils/DeviceVector.cuh (100%) rename {gpu => faiss/gpu}/utils/Float16.cu (100%) rename {gpu => faiss/gpu}/utils/Float16.cuh (100%) rename {gpu => faiss/gpu}/utils/HostTensor-inl.cuh (100%) rename {gpu => faiss/gpu}/utils/HostTensor.cuh (100%) rename {gpu => faiss/gpu}/utils/Limits.cuh (100%) rename {gpu => faiss/gpu}/utils/LoadStoreOperators.cuh (100%) rename {gpu => faiss/gpu}/utils/MathOperators.cuh (100%) rename {gpu => faiss/gpu}/utils/MatrixMult-inl.cuh (100%) rename {gpu => faiss/gpu}/utils/MatrixMult.cu (100%) rename {gpu => faiss/gpu}/utils/MatrixMult.cuh (100%) rename {gpu => faiss/gpu}/utils/MergeNetworkBlock.cuh (100%) rename {gpu => faiss/gpu}/utils/MergeNetworkUtils.cuh (100%) rename {gpu => faiss/gpu}/utils/MergeNetworkWarp.cuh (100%) rename {gpu => faiss/gpu}/utils/NoTypeTensor.cuh (100%) rename {gpu => faiss/gpu}/utils/Pair.cuh (100%) rename {gpu => faiss/gpu}/utils/PtxUtils.cuh (100%) rename {gpu => faiss/gpu}/utils/ReductionOperators.cuh (100%) rename {gpu => faiss/gpu}/utils/Reductions.cuh (100%) rename {gpu => faiss/gpu}/utils/Select.cuh (100%) rename {gpu => faiss/gpu}/utils/StackDeviceMemory.cpp (100%) rename {gpu => faiss/gpu}/utils/StackDeviceMemory.h (100%) rename {gpu => faiss/gpu}/utils/StaticUtils.h (100%) rename {gpu => faiss/gpu}/utils/Tensor-inl.cuh (100%) rename {gpu => faiss/gpu}/utils/Tensor.cuh (100%) rename {gpu => faiss/gpu}/utils/ThrustAllocator.cuh (100%) rename {gpu => faiss/gpu}/utils/Timer.cpp (100%) rename {gpu => faiss/gpu}/utils/Timer.h (100%) rename {gpu => faiss/gpu}/utils/Transpose.cuh (100%) rename {gpu => faiss/gpu}/utils/WarpSelectFloat.cu (100%) rename {gpu => faiss/gpu}/utils/WarpSelectHalf.cu (100%) rename {gpu => faiss/gpu}/utils/WarpSelectKernel.cuh (100%) rename {gpu => faiss/gpu}/utils/WarpShuffles.cuh (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectFloat1.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectFloat128.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectFloat256.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectFloat32.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectFloat64.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectFloatF1024.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectFloatF2048.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectFloatF512.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectFloatT1024.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectFloatT2048.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectFloatT512.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectHalf1.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectHalf128.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectHalf256.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectHalf32.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectHalf64.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectHalfF1024.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectHalfF2048.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectHalfF512.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectHalfT1024.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectHalfT2048.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectHalfT512.cu (100%) rename {gpu => faiss/gpu}/utils/blockselect/BlockSelectImpl.cuh (100%) rename {gpu => faiss/gpu}/utils/nvidia/fp16_emu.cu (100%) rename {gpu => faiss/gpu}/utils/nvidia/fp16_emu.cuh (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectFloat1.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectFloat128.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectFloat256.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectFloat32.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectFloat64.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectFloatF1024.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectFloatF2048.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectFloatF512.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectFloatT1024.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectFloatT2048.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectFloatT512.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectHalf1.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectHalf128.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectHalf256.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectHalf32.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectHalf64.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectHalfF1024.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectHalfF2048.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectHalfF512.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectHalfT1024.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectHalfT2048.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectHalfT512.cu (100%) rename {gpu => faiss/gpu}/utils/warpselect/WarpSelectImpl.cuh (100%) rename {impl => faiss/impl}/AuxIndexStructures.cpp (100%) rename {impl => faiss/impl}/AuxIndexStructures.h (100%) rename {impl => faiss/impl}/FaissAssert.h (100%) rename {impl => faiss/impl}/FaissException.cpp (100%) rename {impl => faiss/impl}/FaissException.h (100%) rename {impl => faiss/impl}/HNSW.cpp (100%) rename {impl => faiss/impl}/HNSW.h (100%) rename {impl => faiss/impl}/PolysemousTraining.cpp (100%) rename {impl => faiss/impl}/PolysemousTraining.h (100%) rename {impl => faiss/impl}/ProductQuantizer-inl.h (100%) rename {impl => faiss/impl}/ProductQuantizer.cpp (100%) rename {impl => faiss/impl}/ProductQuantizer.h (100%) rename {impl => faiss/impl}/ScalarQuantizer.cpp (100%) rename {impl => faiss/impl}/ScalarQuantizer.h (100%) rename {impl => faiss/impl}/ThreadedIndex-inl.h (100%) rename {impl => faiss/impl}/ThreadedIndex.h (100%) rename {impl => faiss/impl}/index_read.cpp (100%) rename {impl => faiss/impl}/index_write.cpp (100%) rename {impl => faiss/impl}/io.cpp (100%) rename {impl => faiss/impl}/io.h (100%) rename {impl => faiss/impl}/io_macros.h (100%) rename {impl => faiss/impl}/lattice_Zn.cpp (100%) rename {impl => faiss/impl}/lattice_Zn.h (100%) rename index_factory.cpp => faiss/index_factory.cpp (100%) rename index_factory.h => faiss/index_factory.h (100%) rename index_io.h => faiss/index_io.h (100%) rename {python => faiss/python}/Makefile (65%) rename {python => faiss/python}/__init__.py (100%) rename {python => faiss/python}/loader.py (100%) rename {python => faiss/python}/python_callbacks.cpp (100%) rename {python => faiss/python}/python_callbacks.h (100%) rename {python => faiss/python}/setup.py (100%) rename {python => faiss/python}/swigfaiss.swig (100%) rename {utils => faiss/utils}/Heap.cpp (100%) rename {utils => faiss/utils}/Heap.h (100%) rename {utils => faiss/utils}/WorkerThread.cpp (100%) rename {utils => faiss/utils}/WorkerThread.h (100%) rename {utils => faiss/utils}/distances.cpp (100%) rename {utils => faiss/utils}/distances.h (100%) rename {utils => faiss/utils}/distances_simd.cpp (100%) rename {utils => faiss/utils}/extra_distances.cpp (100%) rename {utils => faiss/utils}/extra_distances.h (100%) rename {utils => faiss/utils}/hamming-inl.h (100%) rename {utils => faiss/utils}/hamming.cpp (100%) rename {utils => faiss/utils}/hamming.h (100%) rename {utils => faiss/utils}/random.cpp (100%) rename {utils => faiss/utils}/random.h (100%) rename {utils => faiss/utils}/utils.cpp (100%) rename {utils => faiss/utils}/utils.h (100%) delete mode 100644 gpu/impl/Metrics.cuh delete mode 100644 gpu/utils/DeviceMemory.cpp delete mode 100644 gpu/utils/DeviceMemory.h delete mode 100644 gpu/utils/MemorySpace.cpp delete mode 100644 gpu/utils/MemorySpace.h diff --git a/.travis.yml b/.travis.yml index 7fc1de5da..963a564fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -97,7 +97,7 @@ install: - autoconf - ./configure --without-cuda - make - - make -C python + - make -C faiss/python script: - make test diff --git a/Makefile b/Makefile index 280010c98..37f6e6c9b 100644 --- a/Makefile +++ b/Makefile @@ -5,15 +5,18 @@ -include makefile.inc -HEADERS = $(wildcard *.h impl/*.h utils/*.h) -SRC = $(wildcard *.cpp impl/*.cpp utils/*.cpp) +HEADERS = $(wildcard faiss/*.h faiss/impl/*.h faiss/utils/*.h) +SRC = $(wildcard faiss/*.cpp faiss/impl/*.cpp faiss/utils/*.cpp) OBJ = $(SRC:.cpp=.o) INSTALLDIRS = $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)/faiss -GPU_HEADERS = $(wildcard gpu/*.h gpu/impl/*.h gpu/impl/*.cuh gpu/utils/*.h gpu/utils/*.cuh) -GPU_CPPSRC = $(wildcard gpu/*.cpp gpu/impl/*.cpp gpu/utils/*.cpp) -GPU_CUSRC = $(wildcard gpu/*.cu gpu/impl/*.cu gpu/utils/*.cu \ -gpu/utils/nvidia/*.cu gpu/utils/blockselect/*.cu gpu/utils/warpselect/*.cu) +GPU_HEADERS = $(wildcard faiss/gpu/*.h faiss/gpu/impl/*.h faiss/gpu/impl/*.cuh \ +faiss/gpu/utils/*.h faiss/gpu/utils/*.cuh) +GPU_CPPSRC = $(wildcard faiss/gpu/*.cpp faiss/gpu/impl/*.cpp \ +faiss/gpu/utils/*.cpp) +GPU_CUSRC = $(wildcard faiss/gpu/*.cu faiss/gpu/impl/*.cu \ +faiss/gpu/utils/*.cu faiss/gpu/utils/nvidia/*.cu \ +faiss/gpu/utils/blockselect/*.cu faiss/gpu/utils/warpselect/*.cu) GPU_SRC = $(GPU_CPPSRC) $(GPU_CUSRC) GPU_CPPOBJ = $(GPU_CPPSRC:.cpp=.o) GPU_CUOBJ = $(GPU_CUSRC:.cu=.o) @@ -80,7 +83,7 @@ depend: $(SRC) $(GPU_SRC) # Python py: libfaiss.a - $(MAKE) -C python + $(MAKE) -C faiss/python ############################# @@ -88,12 +91,12 @@ py: libfaiss.a test: libfaiss.a py $(MAKE) -C tests run - PYTHONPATH=./python/build/`ls python/build | grep lib` \ + PYTHONPATH=./faiss/python/build/`ls faiss/python/build | grep lib` \ $(PYTHON) -m unittest discover tests/ -v test_gpu: libfaiss.a $(MAKE) -C gpu/test run - PYTHONPATH=./python/build/`ls python/build | grep lib` \ + PYTHONPATH=./faiss/python/build/`ls faiss/python/build | grep lib` \ $(PYTHON) -m unittest discover gpu/test/ -v ############################# diff --git a/configure b/configure index ed40daefd..73433f218 100755 --- a/configure +++ b/configure @@ -587,7 +587,7 @@ PACKAGE_STRING='faiss 1.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' -ac_unique_file="Index.h" +ac_unique_file="faiss/Index.h" # Factoring default headers for most tests. ac_includes_default="\ #include diff --git a/configure.ac b/configure.ac index 31b587b86..af4728138 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ AC_COPYRIGHT([Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.]) -AC_CONFIG_SRCDIR([Index.h]) +AC_CONFIG_SRCDIR([faiss/Index.h]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([acinclude]) diff --git a/faiss b/faiss deleted file mode 120000 index 6a043149e..000000000 --- a/faiss +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/AutoTune.cpp b/faiss/AutoTune.cpp similarity index 100% rename from AutoTune.cpp rename to faiss/AutoTune.cpp diff --git a/AutoTune.h b/faiss/AutoTune.h similarity index 100% rename from AutoTune.h rename to faiss/AutoTune.h diff --git a/Clustering.cpp b/faiss/Clustering.cpp similarity index 100% rename from Clustering.cpp rename to faiss/Clustering.cpp diff --git a/Clustering.h b/faiss/Clustering.h similarity index 100% rename from Clustering.h rename to faiss/Clustering.h diff --git a/DirectMap.cpp b/faiss/DirectMap.cpp similarity index 100% rename from DirectMap.cpp rename to faiss/DirectMap.cpp diff --git a/DirectMap.h b/faiss/DirectMap.h similarity index 100% rename from DirectMap.h rename to faiss/DirectMap.h diff --git a/IVFlib.cpp b/faiss/IVFlib.cpp similarity index 100% rename from IVFlib.cpp rename to faiss/IVFlib.cpp diff --git a/IVFlib.h b/faiss/IVFlib.h similarity index 100% rename from IVFlib.h rename to faiss/IVFlib.h diff --git a/Index.cpp b/faiss/Index.cpp similarity index 100% rename from Index.cpp rename to faiss/Index.cpp diff --git a/Index.h b/faiss/Index.h similarity index 100% rename from Index.h rename to faiss/Index.h diff --git a/Index2Layer.cpp b/faiss/Index2Layer.cpp similarity index 100% rename from Index2Layer.cpp rename to faiss/Index2Layer.cpp diff --git a/Index2Layer.h b/faiss/Index2Layer.h similarity index 100% rename from Index2Layer.h rename to faiss/Index2Layer.h diff --git a/IndexBinary.cpp b/faiss/IndexBinary.cpp similarity index 100% rename from IndexBinary.cpp rename to faiss/IndexBinary.cpp diff --git a/IndexBinary.h b/faiss/IndexBinary.h similarity index 100% rename from IndexBinary.h rename to faiss/IndexBinary.h diff --git a/IndexBinaryFlat.cpp b/faiss/IndexBinaryFlat.cpp similarity index 100% rename from IndexBinaryFlat.cpp rename to faiss/IndexBinaryFlat.cpp diff --git a/IndexBinaryFlat.h b/faiss/IndexBinaryFlat.h similarity index 100% rename from IndexBinaryFlat.h rename to faiss/IndexBinaryFlat.h diff --git a/IndexBinaryFromFloat.cpp b/faiss/IndexBinaryFromFloat.cpp similarity index 100% rename from IndexBinaryFromFloat.cpp rename to faiss/IndexBinaryFromFloat.cpp diff --git a/IndexBinaryFromFloat.h b/faiss/IndexBinaryFromFloat.h similarity index 100% rename from IndexBinaryFromFloat.h rename to faiss/IndexBinaryFromFloat.h diff --git a/IndexBinaryHNSW.cpp b/faiss/IndexBinaryHNSW.cpp similarity index 100% rename from IndexBinaryHNSW.cpp rename to faiss/IndexBinaryHNSW.cpp diff --git a/IndexBinaryHNSW.h b/faiss/IndexBinaryHNSW.h similarity index 100% rename from IndexBinaryHNSW.h rename to faiss/IndexBinaryHNSW.h diff --git a/IndexBinaryHash.cpp b/faiss/IndexBinaryHash.cpp similarity index 100% rename from IndexBinaryHash.cpp rename to faiss/IndexBinaryHash.cpp diff --git a/IndexBinaryHash.h b/faiss/IndexBinaryHash.h similarity index 100% rename from IndexBinaryHash.h rename to faiss/IndexBinaryHash.h diff --git a/IndexBinaryIVF.cpp b/faiss/IndexBinaryIVF.cpp similarity index 100% rename from IndexBinaryIVF.cpp rename to faiss/IndexBinaryIVF.cpp diff --git a/IndexBinaryIVF.h b/faiss/IndexBinaryIVF.h similarity index 100% rename from IndexBinaryIVF.h rename to faiss/IndexBinaryIVF.h diff --git a/IndexFlat.cpp b/faiss/IndexFlat.cpp similarity index 100% rename from IndexFlat.cpp rename to faiss/IndexFlat.cpp diff --git a/IndexFlat.h b/faiss/IndexFlat.h similarity index 100% rename from IndexFlat.h rename to faiss/IndexFlat.h diff --git a/IndexHNSW.cpp b/faiss/IndexHNSW.cpp similarity index 100% rename from IndexHNSW.cpp rename to faiss/IndexHNSW.cpp diff --git a/IndexHNSW.h b/faiss/IndexHNSW.h similarity index 100% rename from IndexHNSW.h rename to faiss/IndexHNSW.h diff --git a/IndexIVF.cpp b/faiss/IndexIVF.cpp similarity index 100% rename from IndexIVF.cpp rename to faiss/IndexIVF.cpp diff --git a/IndexIVF.h b/faiss/IndexIVF.h similarity index 100% rename from IndexIVF.h rename to faiss/IndexIVF.h diff --git a/IndexIVFFlat.cpp b/faiss/IndexIVFFlat.cpp similarity index 100% rename from IndexIVFFlat.cpp rename to faiss/IndexIVFFlat.cpp diff --git a/IndexIVFFlat.h b/faiss/IndexIVFFlat.h similarity index 100% rename from IndexIVFFlat.h rename to faiss/IndexIVFFlat.h diff --git a/IndexIVFPQ.cpp b/faiss/IndexIVFPQ.cpp similarity index 100% rename from IndexIVFPQ.cpp rename to faiss/IndexIVFPQ.cpp diff --git a/IndexIVFPQ.h b/faiss/IndexIVFPQ.h similarity index 100% rename from IndexIVFPQ.h rename to faiss/IndexIVFPQ.h diff --git a/IndexIVFPQR.cpp b/faiss/IndexIVFPQR.cpp similarity index 100% rename from IndexIVFPQR.cpp rename to faiss/IndexIVFPQR.cpp diff --git a/IndexIVFPQR.h b/faiss/IndexIVFPQR.h similarity index 100% rename from IndexIVFPQR.h rename to faiss/IndexIVFPQR.h diff --git a/IndexIVFSpectralHash.cpp b/faiss/IndexIVFSpectralHash.cpp similarity index 100% rename from IndexIVFSpectralHash.cpp rename to faiss/IndexIVFSpectralHash.cpp diff --git a/IndexIVFSpectralHash.h b/faiss/IndexIVFSpectralHash.h similarity index 100% rename from IndexIVFSpectralHash.h rename to faiss/IndexIVFSpectralHash.h diff --git a/IndexLSH.cpp b/faiss/IndexLSH.cpp similarity index 100% rename from IndexLSH.cpp rename to faiss/IndexLSH.cpp diff --git a/IndexLSH.h b/faiss/IndexLSH.h similarity index 100% rename from IndexLSH.h rename to faiss/IndexLSH.h diff --git a/IndexLattice.cpp b/faiss/IndexLattice.cpp similarity index 100% rename from IndexLattice.cpp rename to faiss/IndexLattice.cpp diff --git a/IndexLattice.h b/faiss/IndexLattice.h similarity index 100% rename from IndexLattice.h rename to faiss/IndexLattice.h diff --git a/IndexPQ.cpp b/faiss/IndexPQ.cpp similarity index 100% rename from IndexPQ.cpp rename to faiss/IndexPQ.cpp diff --git a/IndexPQ.h b/faiss/IndexPQ.h similarity index 100% rename from IndexPQ.h rename to faiss/IndexPQ.h diff --git a/IndexPreTransform.cpp b/faiss/IndexPreTransform.cpp similarity index 100% rename from IndexPreTransform.cpp rename to faiss/IndexPreTransform.cpp diff --git a/IndexPreTransform.h b/faiss/IndexPreTransform.h similarity index 100% rename from IndexPreTransform.h rename to faiss/IndexPreTransform.h diff --git a/IndexReplicas.cpp b/faiss/IndexReplicas.cpp similarity index 100% rename from IndexReplicas.cpp rename to faiss/IndexReplicas.cpp diff --git a/IndexReplicas.h b/faiss/IndexReplicas.h similarity index 100% rename from IndexReplicas.h rename to faiss/IndexReplicas.h diff --git a/IndexScalarQuantizer.cpp b/faiss/IndexScalarQuantizer.cpp similarity index 100% rename from IndexScalarQuantizer.cpp rename to faiss/IndexScalarQuantizer.cpp diff --git a/IndexScalarQuantizer.h b/faiss/IndexScalarQuantizer.h similarity index 100% rename from IndexScalarQuantizer.h rename to faiss/IndexScalarQuantizer.h diff --git a/IndexShards.cpp b/faiss/IndexShards.cpp similarity index 100% rename from IndexShards.cpp rename to faiss/IndexShards.cpp diff --git a/IndexShards.h b/faiss/IndexShards.h similarity index 100% rename from IndexShards.h rename to faiss/IndexShards.h diff --git a/InvertedLists.cpp b/faiss/InvertedLists.cpp similarity index 100% rename from InvertedLists.cpp rename to faiss/InvertedLists.cpp diff --git a/InvertedLists.h b/faiss/InvertedLists.h similarity index 100% rename from InvertedLists.h rename to faiss/InvertedLists.h diff --git a/MatrixStats.cpp b/faiss/MatrixStats.cpp similarity index 100% rename from MatrixStats.cpp rename to faiss/MatrixStats.cpp diff --git a/MatrixStats.h b/faiss/MatrixStats.h similarity index 100% rename from MatrixStats.h rename to faiss/MatrixStats.h diff --git a/MetaIndexes.cpp b/faiss/MetaIndexes.cpp similarity index 100% rename from MetaIndexes.cpp rename to faiss/MetaIndexes.cpp diff --git a/MetaIndexes.h b/faiss/MetaIndexes.h similarity index 100% rename from MetaIndexes.h rename to faiss/MetaIndexes.h diff --git a/MetricType.h b/faiss/MetricType.h similarity index 100% rename from MetricType.h rename to faiss/MetricType.h diff --git a/OnDiskInvertedLists.cpp b/faiss/OnDiskInvertedLists.cpp similarity index 100% rename from OnDiskInvertedLists.cpp rename to faiss/OnDiskInvertedLists.cpp diff --git a/OnDiskInvertedLists.h b/faiss/OnDiskInvertedLists.h similarity index 100% rename from OnDiskInvertedLists.h rename to faiss/OnDiskInvertedLists.h diff --git a/VectorTransform.cpp b/faiss/VectorTransform.cpp similarity index 100% rename from VectorTransform.cpp rename to faiss/VectorTransform.cpp diff --git a/VectorTransform.h b/faiss/VectorTransform.h similarity index 100% rename from VectorTransform.h rename to faiss/VectorTransform.h diff --git a/clone_index.cpp b/faiss/clone_index.cpp similarity index 100% rename from clone_index.cpp rename to faiss/clone_index.cpp diff --git a/clone_index.h b/faiss/clone_index.h similarity index 100% rename from clone_index.h rename to faiss/clone_index.h diff --git a/gpu/GpuAutoTune.cpp b/faiss/gpu/GpuAutoTune.cpp similarity index 100% rename from gpu/GpuAutoTune.cpp rename to faiss/gpu/GpuAutoTune.cpp diff --git a/gpu/GpuAutoTune.h b/faiss/gpu/GpuAutoTune.h similarity index 100% rename from gpu/GpuAutoTune.h rename to faiss/gpu/GpuAutoTune.h diff --git a/gpu/GpuCloner.cpp b/faiss/gpu/GpuCloner.cpp similarity index 100% rename from gpu/GpuCloner.cpp rename to faiss/gpu/GpuCloner.cpp diff --git a/gpu/GpuCloner.h b/faiss/gpu/GpuCloner.h similarity index 100% rename from gpu/GpuCloner.h rename to faiss/gpu/GpuCloner.h diff --git a/gpu/GpuClonerOptions.cpp b/faiss/gpu/GpuClonerOptions.cpp similarity index 100% rename from gpu/GpuClonerOptions.cpp rename to faiss/gpu/GpuClonerOptions.cpp diff --git a/gpu/GpuClonerOptions.h b/faiss/gpu/GpuClonerOptions.h similarity index 100% rename from gpu/GpuClonerOptions.h rename to faiss/gpu/GpuClonerOptions.h diff --git a/gpu/GpuDistance.cu b/faiss/gpu/GpuDistance.cu similarity index 100% rename from gpu/GpuDistance.cu rename to faiss/gpu/GpuDistance.cu diff --git a/gpu/GpuDistance.h b/faiss/gpu/GpuDistance.h similarity index 100% rename from gpu/GpuDistance.h rename to faiss/gpu/GpuDistance.h diff --git a/gpu/GpuFaissAssert.h b/faiss/gpu/GpuFaissAssert.h similarity index 100% rename from gpu/GpuFaissAssert.h rename to faiss/gpu/GpuFaissAssert.h diff --git a/gpu/GpuIndex.cu b/faiss/gpu/GpuIndex.cu similarity index 100% rename from gpu/GpuIndex.cu rename to faiss/gpu/GpuIndex.cu diff --git a/gpu/GpuIndex.h b/faiss/gpu/GpuIndex.h similarity index 100% rename from gpu/GpuIndex.h rename to faiss/gpu/GpuIndex.h diff --git a/gpu/GpuIndexBinaryFlat.cu b/faiss/gpu/GpuIndexBinaryFlat.cu similarity index 100% rename from gpu/GpuIndexBinaryFlat.cu rename to faiss/gpu/GpuIndexBinaryFlat.cu diff --git a/gpu/GpuIndexBinaryFlat.h b/faiss/gpu/GpuIndexBinaryFlat.h similarity index 100% rename from gpu/GpuIndexBinaryFlat.h rename to faiss/gpu/GpuIndexBinaryFlat.h diff --git a/gpu/GpuIndexFlat.cu b/faiss/gpu/GpuIndexFlat.cu similarity index 100% rename from gpu/GpuIndexFlat.cu rename to faiss/gpu/GpuIndexFlat.cu diff --git a/gpu/GpuIndexFlat.h b/faiss/gpu/GpuIndexFlat.h similarity index 100% rename from gpu/GpuIndexFlat.h rename to faiss/gpu/GpuIndexFlat.h diff --git a/gpu/GpuIndexIVF.cu b/faiss/gpu/GpuIndexIVF.cu similarity index 100% rename from gpu/GpuIndexIVF.cu rename to faiss/gpu/GpuIndexIVF.cu diff --git a/gpu/GpuIndexIVF.h b/faiss/gpu/GpuIndexIVF.h similarity index 100% rename from gpu/GpuIndexIVF.h rename to faiss/gpu/GpuIndexIVF.h diff --git a/gpu/GpuIndexIVFFlat.cu b/faiss/gpu/GpuIndexIVFFlat.cu similarity index 100% rename from gpu/GpuIndexIVFFlat.cu rename to faiss/gpu/GpuIndexIVFFlat.cu diff --git a/gpu/GpuIndexIVFFlat.h b/faiss/gpu/GpuIndexIVFFlat.h similarity index 100% rename from gpu/GpuIndexIVFFlat.h rename to faiss/gpu/GpuIndexIVFFlat.h diff --git a/gpu/GpuIndexIVFPQ.cu b/faiss/gpu/GpuIndexIVFPQ.cu similarity index 100% rename from gpu/GpuIndexIVFPQ.cu rename to faiss/gpu/GpuIndexIVFPQ.cu diff --git a/gpu/GpuIndexIVFPQ.h b/faiss/gpu/GpuIndexIVFPQ.h similarity index 100% rename from gpu/GpuIndexIVFPQ.h rename to faiss/gpu/GpuIndexIVFPQ.h diff --git a/gpu/GpuIndexIVFScalarQuantizer.cu b/faiss/gpu/GpuIndexIVFScalarQuantizer.cu similarity index 100% rename from gpu/GpuIndexIVFScalarQuantizer.cu rename to faiss/gpu/GpuIndexIVFScalarQuantizer.cu diff --git a/gpu/GpuIndexIVFScalarQuantizer.h b/faiss/gpu/GpuIndexIVFScalarQuantizer.h similarity index 100% rename from gpu/GpuIndexIVFScalarQuantizer.h rename to faiss/gpu/GpuIndexIVFScalarQuantizer.h diff --git a/gpu/GpuIndicesOptions.h b/faiss/gpu/GpuIndicesOptions.h similarity index 100% rename from gpu/GpuIndicesOptions.h rename to faiss/gpu/GpuIndicesOptions.h diff --git a/gpu/GpuResources.cpp b/faiss/gpu/GpuResources.cpp similarity index 100% rename from gpu/GpuResources.cpp rename to faiss/gpu/GpuResources.cpp diff --git a/gpu/GpuResources.h b/faiss/gpu/GpuResources.h similarity index 100% rename from gpu/GpuResources.h rename to faiss/gpu/GpuResources.h diff --git a/gpu/StandardGpuResources.cpp b/faiss/gpu/StandardGpuResources.cpp similarity index 100% rename from gpu/StandardGpuResources.cpp rename to faiss/gpu/StandardGpuResources.cpp diff --git a/gpu/StandardGpuResources.h b/faiss/gpu/StandardGpuResources.h similarity index 100% rename from gpu/StandardGpuResources.h rename to faiss/gpu/StandardGpuResources.h diff --git a/gpu/impl/BinaryDistance.cu b/faiss/gpu/impl/BinaryDistance.cu similarity index 100% rename from gpu/impl/BinaryDistance.cu rename to faiss/gpu/impl/BinaryDistance.cu diff --git a/gpu/impl/BinaryDistance.cuh b/faiss/gpu/impl/BinaryDistance.cuh similarity index 100% rename from gpu/impl/BinaryDistance.cuh rename to faiss/gpu/impl/BinaryDistance.cuh diff --git a/gpu/impl/BinaryFlatIndex.cu b/faiss/gpu/impl/BinaryFlatIndex.cu similarity index 100% rename from gpu/impl/BinaryFlatIndex.cu rename to faiss/gpu/impl/BinaryFlatIndex.cu diff --git a/gpu/impl/BinaryFlatIndex.cuh b/faiss/gpu/impl/BinaryFlatIndex.cuh similarity index 100% rename from gpu/impl/BinaryFlatIndex.cuh rename to faiss/gpu/impl/BinaryFlatIndex.cuh diff --git a/gpu/impl/BroadcastSum.cu b/faiss/gpu/impl/BroadcastSum.cu similarity index 100% rename from gpu/impl/BroadcastSum.cu rename to faiss/gpu/impl/BroadcastSum.cu diff --git a/gpu/impl/BroadcastSum.cuh b/faiss/gpu/impl/BroadcastSum.cuh similarity index 100% rename from gpu/impl/BroadcastSum.cuh rename to faiss/gpu/impl/BroadcastSum.cuh diff --git a/gpu/impl/Distance.cu b/faiss/gpu/impl/Distance.cu similarity index 100% rename from gpu/impl/Distance.cu rename to faiss/gpu/impl/Distance.cu diff --git a/gpu/impl/Distance.cuh b/faiss/gpu/impl/Distance.cuh similarity index 100% rename from gpu/impl/Distance.cuh rename to faiss/gpu/impl/Distance.cuh diff --git a/gpu/impl/DistanceUtils.cuh b/faiss/gpu/impl/DistanceUtils.cuh similarity index 100% rename from gpu/impl/DistanceUtils.cuh rename to faiss/gpu/impl/DistanceUtils.cuh diff --git a/gpu/impl/FlatIndex.cu b/faiss/gpu/impl/FlatIndex.cu similarity index 100% rename from gpu/impl/FlatIndex.cu rename to faiss/gpu/impl/FlatIndex.cu diff --git a/gpu/impl/FlatIndex.cuh b/faiss/gpu/impl/FlatIndex.cuh similarity index 100% rename from gpu/impl/FlatIndex.cuh rename to faiss/gpu/impl/FlatIndex.cuh diff --git a/gpu/impl/GeneralDistance.cuh b/faiss/gpu/impl/GeneralDistance.cuh similarity index 100% rename from gpu/impl/GeneralDistance.cuh rename to faiss/gpu/impl/GeneralDistance.cuh diff --git a/gpu/impl/GpuScalarQuantizer.cuh b/faiss/gpu/impl/GpuScalarQuantizer.cuh similarity index 100% rename from gpu/impl/GpuScalarQuantizer.cuh rename to faiss/gpu/impl/GpuScalarQuantizer.cuh diff --git a/gpu/impl/IVFAppend.cu b/faiss/gpu/impl/IVFAppend.cu similarity index 100% rename from gpu/impl/IVFAppend.cu rename to faiss/gpu/impl/IVFAppend.cu diff --git a/gpu/impl/IVFAppend.cuh b/faiss/gpu/impl/IVFAppend.cuh similarity index 100% rename from gpu/impl/IVFAppend.cuh rename to faiss/gpu/impl/IVFAppend.cuh diff --git a/gpu/impl/IVFBase.cu b/faiss/gpu/impl/IVFBase.cu similarity index 100% rename from gpu/impl/IVFBase.cu rename to faiss/gpu/impl/IVFBase.cu diff --git a/gpu/impl/IVFBase.cuh b/faiss/gpu/impl/IVFBase.cuh similarity index 100% rename from gpu/impl/IVFBase.cuh rename to faiss/gpu/impl/IVFBase.cuh diff --git a/gpu/impl/IVFFlat.cu b/faiss/gpu/impl/IVFFlat.cu similarity index 100% rename from gpu/impl/IVFFlat.cu rename to faiss/gpu/impl/IVFFlat.cu diff --git a/gpu/impl/IVFFlat.cuh b/faiss/gpu/impl/IVFFlat.cuh similarity index 100% rename from gpu/impl/IVFFlat.cuh rename to faiss/gpu/impl/IVFFlat.cuh diff --git a/gpu/impl/IVFFlatScan.cu b/faiss/gpu/impl/IVFFlatScan.cu similarity index 100% rename from gpu/impl/IVFFlatScan.cu rename to faiss/gpu/impl/IVFFlatScan.cu diff --git a/gpu/impl/IVFFlatScan.cuh b/faiss/gpu/impl/IVFFlatScan.cuh similarity index 100% rename from gpu/impl/IVFFlatScan.cuh rename to faiss/gpu/impl/IVFFlatScan.cuh diff --git a/gpu/impl/IVFPQ.cu b/faiss/gpu/impl/IVFPQ.cu similarity index 100% rename from gpu/impl/IVFPQ.cu rename to faiss/gpu/impl/IVFPQ.cu diff --git a/gpu/impl/IVFPQ.cuh b/faiss/gpu/impl/IVFPQ.cuh similarity index 100% rename from gpu/impl/IVFPQ.cuh rename to faiss/gpu/impl/IVFPQ.cuh diff --git a/gpu/impl/IVFUtils.cu b/faiss/gpu/impl/IVFUtils.cu similarity index 100% rename from gpu/impl/IVFUtils.cu rename to faiss/gpu/impl/IVFUtils.cu diff --git a/gpu/impl/IVFUtils.cuh b/faiss/gpu/impl/IVFUtils.cuh similarity index 100% rename from gpu/impl/IVFUtils.cuh rename to faiss/gpu/impl/IVFUtils.cuh diff --git a/gpu/impl/IVFUtilsSelect1.cu b/faiss/gpu/impl/IVFUtilsSelect1.cu similarity index 100% rename from gpu/impl/IVFUtilsSelect1.cu rename to faiss/gpu/impl/IVFUtilsSelect1.cu diff --git a/gpu/impl/IVFUtilsSelect2.cu b/faiss/gpu/impl/IVFUtilsSelect2.cu similarity index 100% rename from gpu/impl/IVFUtilsSelect2.cu rename to faiss/gpu/impl/IVFUtilsSelect2.cu diff --git a/gpu/impl/L2Norm.cu b/faiss/gpu/impl/L2Norm.cu similarity index 100% rename from gpu/impl/L2Norm.cu rename to faiss/gpu/impl/L2Norm.cu diff --git a/gpu/impl/L2Norm.cuh b/faiss/gpu/impl/L2Norm.cuh similarity index 100% rename from gpu/impl/L2Norm.cuh rename to faiss/gpu/impl/L2Norm.cuh diff --git a/gpu/impl/L2Select.cu b/faiss/gpu/impl/L2Select.cu similarity index 100% rename from gpu/impl/L2Select.cu rename to faiss/gpu/impl/L2Select.cu diff --git a/gpu/impl/L2Select.cuh b/faiss/gpu/impl/L2Select.cuh similarity index 100% rename from gpu/impl/L2Select.cuh rename to faiss/gpu/impl/L2Select.cuh diff --git a/gpu/impl/PQCodeDistances-inl.cuh b/faiss/gpu/impl/PQCodeDistances-inl.cuh similarity index 100% rename from gpu/impl/PQCodeDistances-inl.cuh rename to faiss/gpu/impl/PQCodeDistances-inl.cuh diff --git a/gpu/impl/PQCodeDistances.cuh b/faiss/gpu/impl/PQCodeDistances.cuh similarity index 100% rename from gpu/impl/PQCodeDistances.cuh rename to faiss/gpu/impl/PQCodeDistances.cuh diff --git a/gpu/impl/PQCodeLoad.cuh b/faiss/gpu/impl/PQCodeLoad.cuh similarity index 100% rename from gpu/impl/PQCodeLoad.cuh rename to faiss/gpu/impl/PQCodeLoad.cuh diff --git a/gpu/impl/PQScanMultiPassNoPrecomputed-inl.cuh b/faiss/gpu/impl/PQScanMultiPassNoPrecomputed-inl.cuh similarity index 100% rename from gpu/impl/PQScanMultiPassNoPrecomputed-inl.cuh rename to faiss/gpu/impl/PQScanMultiPassNoPrecomputed-inl.cuh diff --git a/gpu/impl/PQScanMultiPassNoPrecomputed.cuh b/faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cuh similarity index 100% rename from gpu/impl/PQScanMultiPassNoPrecomputed.cuh rename to faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cuh diff --git a/gpu/impl/PQScanMultiPassPrecomputed.cu b/faiss/gpu/impl/PQScanMultiPassPrecomputed.cu similarity index 100% rename from gpu/impl/PQScanMultiPassPrecomputed.cu rename to faiss/gpu/impl/PQScanMultiPassPrecomputed.cu diff --git a/gpu/impl/PQScanMultiPassPrecomputed.cuh b/faiss/gpu/impl/PQScanMultiPassPrecomputed.cuh similarity index 100% rename from gpu/impl/PQScanMultiPassPrecomputed.cuh rename to faiss/gpu/impl/PQScanMultiPassPrecomputed.cuh diff --git a/gpu/impl/RemapIndices.cpp b/faiss/gpu/impl/RemapIndices.cpp similarity index 100% rename from gpu/impl/RemapIndices.cpp rename to faiss/gpu/impl/RemapIndices.cpp diff --git a/gpu/impl/RemapIndices.h b/faiss/gpu/impl/RemapIndices.h similarity index 100% rename from gpu/impl/RemapIndices.h rename to faiss/gpu/impl/RemapIndices.h diff --git a/gpu/impl/VectorResidual.cu b/faiss/gpu/impl/VectorResidual.cu similarity index 100% rename from gpu/impl/VectorResidual.cu rename to faiss/gpu/impl/VectorResidual.cu diff --git a/gpu/impl/VectorResidual.cuh b/faiss/gpu/impl/VectorResidual.cuh similarity index 100% rename from gpu/impl/VectorResidual.cuh rename to faiss/gpu/impl/VectorResidual.cuh diff --git a/gpu/perf/IndexWrapper-inl.h b/faiss/gpu/perf/IndexWrapper-inl.h similarity index 100% rename from gpu/perf/IndexWrapper-inl.h rename to faiss/gpu/perf/IndexWrapper-inl.h diff --git a/gpu/perf/IndexWrapper.h b/faiss/gpu/perf/IndexWrapper.h similarity index 100% rename from gpu/perf/IndexWrapper.h rename to faiss/gpu/perf/IndexWrapper.h diff --git a/gpu/perf/PerfBinaryFlat.cu b/faiss/gpu/perf/PerfBinaryFlat.cu similarity index 100% rename from gpu/perf/PerfBinaryFlat.cu rename to faiss/gpu/perf/PerfBinaryFlat.cu diff --git a/gpu/perf/PerfClustering.cpp b/faiss/gpu/perf/PerfClustering.cpp similarity index 100% rename from gpu/perf/PerfClustering.cpp rename to faiss/gpu/perf/PerfClustering.cpp diff --git a/gpu/perf/PerfFlat.cu b/faiss/gpu/perf/PerfFlat.cu similarity index 100% rename from gpu/perf/PerfFlat.cu rename to faiss/gpu/perf/PerfFlat.cu diff --git a/gpu/perf/PerfIVFFlat.cu b/faiss/gpu/perf/PerfIVFFlat.cu similarity index 100% rename from gpu/perf/PerfIVFFlat.cu rename to faiss/gpu/perf/PerfIVFFlat.cu diff --git a/gpu/perf/PerfIVFPQ.cu b/faiss/gpu/perf/PerfIVFPQ.cu similarity index 100% rename from gpu/perf/PerfIVFPQ.cu rename to faiss/gpu/perf/PerfIVFPQ.cu diff --git a/gpu/perf/PerfIVFPQAdd.cpp b/faiss/gpu/perf/PerfIVFPQAdd.cpp similarity index 100% rename from gpu/perf/PerfIVFPQAdd.cpp rename to faiss/gpu/perf/PerfIVFPQAdd.cpp diff --git a/gpu/perf/PerfSelect.cu b/faiss/gpu/perf/PerfSelect.cu similarity index 100% rename from gpu/perf/PerfSelect.cu rename to faiss/gpu/perf/PerfSelect.cu diff --git a/gpu/perf/WriteIndex.cpp b/faiss/gpu/perf/WriteIndex.cpp similarity index 100% rename from gpu/perf/WriteIndex.cpp rename to faiss/gpu/perf/WriteIndex.cpp diff --git a/gpu/perf/slow.py b/faiss/gpu/perf/slow.py similarity index 100% rename from gpu/perf/slow.py rename to faiss/gpu/perf/slow.py diff --git a/gpu/test/Makefile b/faiss/gpu/test/Makefile similarity index 100% rename from gpu/test/Makefile rename to faiss/gpu/test/Makefile diff --git a/gpu/test/TestGpuDistance.cu b/faiss/gpu/test/TestGpuDistance.cu similarity index 100% rename from gpu/test/TestGpuDistance.cu rename to faiss/gpu/test/TestGpuDistance.cu diff --git a/gpu/test/TestGpuIndexBinaryFlat.cpp b/faiss/gpu/test/TestGpuIndexBinaryFlat.cpp similarity index 100% rename from gpu/test/TestGpuIndexBinaryFlat.cpp rename to faiss/gpu/test/TestGpuIndexBinaryFlat.cpp diff --git a/gpu/test/TestGpuIndexFlat.cpp b/faiss/gpu/test/TestGpuIndexFlat.cpp similarity index 100% rename from gpu/test/TestGpuIndexFlat.cpp rename to faiss/gpu/test/TestGpuIndexFlat.cpp diff --git a/gpu/test/TestGpuIndexIVFFlat.cpp b/faiss/gpu/test/TestGpuIndexIVFFlat.cpp similarity index 100% rename from gpu/test/TestGpuIndexIVFFlat.cpp rename to faiss/gpu/test/TestGpuIndexIVFFlat.cpp diff --git a/gpu/test/TestGpuIndexIVFPQ.cpp b/faiss/gpu/test/TestGpuIndexIVFPQ.cpp similarity index 100% rename from gpu/test/TestGpuIndexIVFPQ.cpp rename to faiss/gpu/test/TestGpuIndexIVFPQ.cpp diff --git a/gpu/test/TestGpuMemoryException.cpp b/faiss/gpu/test/TestGpuMemoryException.cpp similarity index 100% rename from gpu/test/TestGpuMemoryException.cpp rename to faiss/gpu/test/TestGpuMemoryException.cpp diff --git a/gpu/test/TestGpuSelect.cu b/faiss/gpu/test/TestGpuSelect.cu similarity index 100% rename from gpu/test/TestGpuSelect.cu rename to faiss/gpu/test/TestGpuSelect.cu diff --git a/gpu/test/TestUtils.cpp b/faiss/gpu/test/TestUtils.cpp similarity index 100% rename from gpu/test/TestUtils.cpp rename to faiss/gpu/test/TestUtils.cpp diff --git a/gpu/test/TestUtils.h b/faiss/gpu/test/TestUtils.h similarity index 100% rename from gpu/test/TestUtils.h rename to faiss/gpu/test/TestUtils.h diff --git a/gpu/test/demo_ivfpq_indexing_gpu.cpp b/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp similarity index 100% rename from gpu/test/demo_ivfpq_indexing_gpu.cpp rename to faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp diff --git a/gpu/test/test_gpu_index.py b/faiss/gpu/test/test_gpu_index.py similarity index 100% rename from gpu/test/test_gpu_index.py rename to faiss/gpu/test/test_gpu_index.py diff --git a/gpu/test/test_gpu_index_ivfsq.py b/faiss/gpu/test/test_gpu_index_ivfsq.py similarity index 100% rename from gpu/test/test_gpu_index_ivfsq.py rename to faiss/gpu/test/test_gpu_index_ivfsq.py diff --git a/gpu/test/test_pytorch_faiss.py b/faiss/gpu/test/test_pytorch_faiss.py similarity index 100% rename from gpu/test/test_pytorch_faiss.py rename to faiss/gpu/test/test_pytorch_faiss.py diff --git a/gpu/utils/BlockSelectFloat.cu b/faiss/gpu/utils/BlockSelectFloat.cu similarity index 100% rename from gpu/utils/BlockSelectFloat.cu rename to faiss/gpu/utils/BlockSelectFloat.cu diff --git a/gpu/utils/BlockSelectHalf.cu b/faiss/gpu/utils/BlockSelectHalf.cu similarity index 100% rename from gpu/utils/BlockSelectHalf.cu rename to faiss/gpu/utils/BlockSelectHalf.cu diff --git a/gpu/utils/BlockSelectKernel.cuh b/faiss/gpu/utils/BlockSelectKernel.cuh similarity index 100% rename from gpu/utils/BlockSelectKernel.cuh rename to faiss/gpu/utils/BlockSelectKernel.cuh diff --git a/gpu/utils/Comparators.cuh b/faiss/gpu/utils/Comparators.cuh similarity index 100% rename from gpu/utils/Comparators.cuh rename to faiss/gpu/utils/Comparators.cuh diff --git a/gpu/utils/ConversionOperators.cuh b/faiss/gpu/utils/ConversionOperators.cuh similarity index 100% rename from gpu/utils/ConversionOperators.cuh rename to faiss/gpu/utils/ConversionOperators.cuh diff --git a/gpu/utils/CopyUtils.cuh b/faiss/gpu/utils/CopyUtils.cuh similarity index 100% rename from gpu/utils/CopyUtils.cuh rename to faiss/gpu/utils/CopyUtils.cuh diff --git a/gpu/utils/DeviceDefs.cuh b/faiss/gpu/utils/DeviceDefs.cuh similarity index 100% rename from gpu/utils/DeviceDefs.cuh rename to faiss/gpu/utils/DeviceDefs.cuh diff --git a/gpu/utils/DeviceTensor-inl.cuh b/faiss/gpu/utils/DeviceTensor-inl.cuh similarity index 100% rename from gpu/utils/DeviceTensor-inl.cuh rename to faiss/gpu/utils/DeviceTensor-inl.cuh diff --git a/gpu/utils/DeviceTensor.cuh b/faiss/gpu/utils/DeviceTensor.cuh similarity index 100% rename from gpu/utils/DeviceTensor.cuh rename to faiss/gpu/utils/DeviceTensor.cuh diff --git a/gpu/utils/DeviceUtils.cu b/faiss/gpu/utils/DeviceUtils.cu similarity index 100% rename from gpu/utils/DeviceUtils.cu rename to faiss/gpu/utils/DeviceUtils.cu diff --git a/gpu/utils/DeviceUtils.h b/faiss/gpu/utils/DeviceUtils.h similarity index 100% rename from gpu/utils/DeviceUtils.h rename to faiss/gpu/utils/DeviceUtils.h diff --git a/gpu/utils/DeviceVector.cuh b/faiss/gpu/utils/DeviceVector.cuh similarity index 100% rename from gpu/utils/DeviceVector.cuh rename to faiss/gpu/utils/DeviceVector.cuh diff --git a/gpu/utils/Float16.cu b/faiss/gpu/utils/Float16.cu similarity index 100% rename from gpu/utils/Float16.cu rename to faiss/gpu/utils/Float16.cu diff --git a/gpu/utils/Float16.cuh b/faiss/gpu/utils/Float16.cuh similarity index 100% rename from gpu/utils/Float16.cuh rename to faiss/gpu/utils/Float16.cuh diff --git a/gpu/utils/HostTensor-inl.cuh b/faiss/gpu/utils/HostTensor-inl.cuh similarity index 100% rename from gpu/utils/HostTensor-inl.cuh rename to faiss/gpu/utils/HostTensor-inl.cuh diff --git a/gpu/utils/HostTensor.cuh b/faiss/gpu/utils/HostTensor.cuh similarity index 100% rename from gpu/utils/HostTensor.cuh rename to faiss/gpu/utils/HostTensor.cuh diff --git a/gpu/utils/Limits.cuh b/faiss/gpu/utils/Limits.cuh similarity index 100% rename from gpu/utils/Limits.cuh rename to faiss/gpu/utils/Limits.cuh diff --git a/gpu/utils/LoadStoreOperators.cuh b/faiss/gpu/utils/LoadStoreOperators.cuh similarity index 100% rename from gpu/utils/LoadStoreOperators.cuh rename to faiss/gpu/utils/LoadStoreOperators.cuh diff --git a/gpu/utils/MathOperators.cuh b/faiss/gpu/utils/MathOperators.cuh similarity index 100% rename from gpu/utils/MathOperators.cuh rename to faiss/gpu/utils/MathOperators.cuh diff --git a/gpu/utils/MatrixMult-inl.cuh b/faiss/gpu/utils/MatrixMult-inl.cuh similarity index 100% rename from gpu/utils/MatrixMult-inl.cuh rename to faiss/gpu/utils/MatrixMult-inl.cuh diff --git a/gpu/utils/MatrixMult.cu b/faiss/gpu/utils/MatrixMult.cu similarity index 100% rename from gpu/utils/MatrixMult.cu rename to faiss/gpu/utils/MatrixMult.cu diff --git a/gpu/utils/MatrixMult.cuh b/faiss/gpu/utils/MatrixMult.cuh similarity index 100% rename from gpu/utils/MatrixMult.cuh rename to faiss/gpu/utils/MatrixMult.cuh diff --git a/gpu/utils/MergeNetworkBlock.cuh b/faiss/gpu/utils/MergeNetworkBlock.cuh similarity index 100% rename from gpu/utils/MergeNetworkBlock.cuh rename to faiss/gpu/utils/MergeNetworkBlock.cuh diff --git a/gpu/utils/MergeNetworkUtils.cuh b/faiss/gpu/utils/MergeNetworkUtils.cuh similarity index 100% rename from gpu/utils/MergeNetworkUtils.cuh rename to faiss/gpu/utils/MergeNetworkUtils.cuh diff --git a/gpu/utils/MergeNetworkWarp.cuh b/faiss/gpu/utils/MergeNetworkWarp.cuh similarity index 100% rename from gpu/utils/MergeNetworkWarp.cuh rename to faiss/gpu/utils/MergeNetworkWarp.cuh diff --git a/gpu/utils/NoTypeTensor.cuh b/faiss/gpu/utils/NoTypeTensor.cuh similarity index 100% rename from gpu/utils/NoTypeTensor.cuh rename to faiss/gpu/utils/NoTypeTensor.cuh diff --git a/gpu/utils/Pair.cuh b/faiss/gpu/utils/Pair.cuh similarity index 100% rename from gpu/utils/Pair.cuh rename to faiss/gpu/utils/Pair.cuh diff --git a/gpu/utils/PtxUtils.cuh b/faiss/gpu/utils/PtxUtils.cuh similarity index 100% rename from gpu/utils/PtxUtils.cuh rename to faiss/gpu/utils/PtxUtils.cuh diff --git a/gpu/utils/ReductionOperators.cuh b/faiss/gpu/utils/ReductionOperators.cuh similarity index 100% rename from gpu/utils/ReductionOperators.cuh rename to faiss/gpu/utils/ReductionOperators.cuh diff --git a/gpu/utils/Reductions.cuh b/faiss/gpu/utils/Reductions.cuh similarity index 100% rename from gpu/utils/Reductions.cuh rename to faiss/gpu/utils/Reductions.cuh diff --git a/gpu/utils/Select.cuh b/faiss/gpu/utils/Select.cuh similarity index 100% rename from gpu/utils/Select.cuh rename to faiss/gpu/utils/Select.cuh diff --git a/gpu/utils/StackDeviceMemory.cpp b/faiss/gpu/utils/StackDeviceMemory.cpp similarity index 100% rename from gpu/utils/StackDeviceMemory.cpp rename to faiss/gpu/utils/StackDeviceMemory.cpp diff --git a/gpu/utils/StackDeviceMemory.h b/faiss/gpu/utils/StackDeviceMemory.h similarity index 100% rename from gpu/utils/StackDeviceMemory.h rename to faiss/gpu/utils/StackDeviceMemory.h diff --git a/gpu/utils/StaticUtils.h b/faiss/gpu/utils/StaticUtils.h similarity index 100% rename from gpu/utils/StaticUtils.h rename to faiss/gpu/utils/StaticUtils.h diff --git a/gpu/utils/Tensor-inl.cuh b/faiss/gpu/utils/Tensor-inl.cuh similarity index 100% rename from gpu/utils/Tensor-inl.cuh rename to faiss/gpu/utils/Tensor-inl.cuh diff --git a/gpu/utils/Tensor.cuh b/faiss/gpu/utils/Tensor.cuh similarity index 100% rename from gpu/utils/Tensor.cuh rename to faiss/gpu/utils/Tensor.cuh diff --git a/gpu/utils/ThrustAllocator.cuh b/faiss/gpu/utils/ThrustAllocator.cuh similarity index 100% rename from gpu/utils/ThrustAllocator.cuh rename to faiss/gpu/utils/ThrustAllocator.cuh diff --git a/gpu/utils/Timer.cpp b/faiss/gpu/utils/Timer.cpp similarity index 100% rename from gpu/utils/Timer.cpp rename to faiss/gpu/utils/Timer.cpp diff --git a/gpu/utils/Timer.h b/faiss/gpu/utils/Timer.h similarity index 100% rename from gpu/utils/Timer.h rename to faiss/gpu/utils/Timer.h diff --git a/gpu/utils/Transpose.cuh b/faiss/gpu/utils/Transpose.cuh similarity index 100% rename from gpu/utils/Transpose.cuh rename to faiss/gpu/utils/Transpose.cuh diff --git a/gpu/utils/WarpSelectFloat.cu b/faiss/gpu/utils/WarpSelectFloat.cu similarity index 100% rename from gpu/utils/WarpSelectFloat.cu rename to faiss/gpu/utils/WarpSelectFloat.cu diff --git a/gpu/utils/WarpSelectHalf.cu b/faiss/gpu/utils/WarpSelectHalf.cu similarity index 100% rename from gpu/utils/WarpSelectHalf.cu rename to faiss/gpu/utils/WarpSelectHalf.cu diff --git a/gpu/utils/WarpSelectKernel.cuh b/faiss/gpu/utils/WarpSelectKernel.cuh similarity index 100% rename from gpu/utils/WarpSelectKernel.cuh rename to faiss/gpu/utils/WarpSelectKernel.cuh diff --git a/gpu/utils/WarpShuffles.cuh b/faiss/gpu/utils/WarpShuffles.cuh similarity index 100% rename from gpu/utils/WarpShuffles.cuh rename to faiss/gpu/utils/WarpShuffles.cuh diff --git a/gpu/utils/blockselect/BlockSelectFloat1.cu b/faiss/gpu/utils/blockselect/BlockSelectFloat1.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectFloat1.cu rename to faiss/gpu/utils/blockselect/BlockSelectFloat1.cu diff --git a/gpu/utils/blockselect/BlockSelectFloat128.cu b/faiss/gpu/utils/blockselect/BlockSelectFloat128.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectFloat128.cu rename to faiss/gpu/utils/blockselect/BlockSelectFloat128.cu diff --git a/gpu/utils/blockselect/BlockSelectFloat256.cu b/faiss/gpu/utils/blockselect/BlockSelectFloat256.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectFloat256.cu rename to faiss/gpu/utils/blockselect/BlockSelectFloat256.cu diff --git a/gpu/utils/blockselect/BlockSelectFloat32.cu b/faiss/gpu/utils/blockselect/BlockSelectFloat32.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectFloat32.cu rename to faiss/gpu/utils/blockselect/BlockSelectFloat32.cu diff --git a/gpu/utils/blockselect/BlockSelectFloat64.cu b/faiss/gpu/utils/blockselect/BlockSelectFloat64.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectFloat64.cu rename to faiss/gpu/utils/blockselect/BlockSelectFloat64.cu diff --git a/gpu/utils/blockselect/BlockSelectFloatF1024.cu b/faiss/gpu/utils/blockselect/BlockSelectFloatF1024.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectFloatF1024.cu rename to faiss/gpu/utils/blockselect/BlockSelectFloatF1024.cu diff --git a/gpu/utils/blockselect/BlockSelectFloatF2048.cu b/faiss/gpu/utils/blockselect/BlockSelectFloatF2048.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectFloatF2048.cu rename to faiss/gpu/utils/blockselect/BlockSelectFloatF2048.cu diff --git a/gpu/utils/blockselect/BlockSelectFloatF512.cu b/faiss/gpu/utils/blockselect/BlockSelectFloatF512.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectFloatF512.cu rename to faiss/gpu/utils/blockselect/BlockSelectFloatF512.cu diff --git a/gpu/utils/blockselect/BlockSelectFloatT1024.cu b/faiss/gpu/utils/blockselect/BlockSelectFloatT1024.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectFloatT1024.cu rename to faiss/gpu/utils/blockselect/BlockSelectFloatT1024.cu diff --git a/gpu/utils/blockselect/BlockSelectFloatT2048.cu b/faiss/gpu/utils/blockselect/BlockSelectFloatT2048.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectFloatT2048.cu rename to faiss/gpu/utils/blockselect/BlockSelectFloatT2048.cu diff --git a/gpu/utils/blockselect/BlockSelectFloatT512.cu b/faiss/gpu/utils/blockselect/BlockSelectFloatT512.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectFloatT512.cu rename to faiss/gpu/utils/blockselect/BlockSelectFloatT512.cu diff --git a/gpu/utils/blockselect/BlockSelectHalf1.cu b/faiss/gpu/utils/blockselect/BlockSelectHalf1.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectHalf1.cu rename to faiss/gpu/utils/blockselect/BlockSelectHalf1.cu diff --git a/gpu/utils/blockselect/BlockSelectHalf128.cu b/faiss/gpu/utils/blockselect/BlockSelectHalf128.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectHalf128.cu rename to faiss/gpu/utils/blockselect/BlockSelectHalf128.cu diff --git a/gpu/utils/blockselect/BlockSelectHalf256.cu b/faiss/gpu/utils/blockselect/BlockSelectHalf256.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectHalf256.cu rename to faiss/gpu/utils/blockselect/BlockSelectHalf256.cu diff --git a/gpu/utils/blockselect/BlockSelectHalf32.cu b/faiss/gpu/utils/blockselect/BlockSelectHalf32.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectHalf32.cu rename to faiss/gpu/utils/blockselect/BlockSelectHalf32.cu diff --git a/gpu/utils/blockselect/BlockSelectHalf64.cu b/faiss/gpu/utils/blockselect/BlockSelectHalf64.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectHalf64.cu rename to faiss/gpu/utils/blockselect/BlockSelectHalf64.cu diff --git a/gpu/utils/blockselect/BlockSelectHalfF1024.cu b/faiss/gpu/utils/blockselect/BlockSelectHalfF1024.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectHalfF1024.cu rename to faiss/gpu/utils/blockselect/BlockSelectHalfF1024.cu diff --git a/gpu/utils/blockselect/BlockSelectHalfF2048.cu b/faiss/gpu/utils/blockselect/BlockSelectHalfF2048.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectHalfF2048.cu rename to faiss/gpu/utils/blockselect/BlockSelectHalfF2048.cu diff --git a/gpu/utils/blockselect/BlockSelectHalfF512.cu b/faiss/gpu/utils/blockselect/BlockSelectHalfF512.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectHalfF512.cu rename to faiss/gpu/utils/blockselect/BlockSelectHalfF512.cu diff --git a/gpu/utils/blockselect/BlockSelectHalfT1024.cu b/faiss/gpu/utils/blockselect/BlockSelectHalfT1024.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectHalfT1024.cu rename to faiss/gpu/utils/blockselect/BlockSelectHalfT1024.cu diff --git a/gpu/utils/blockselect/BlockSelectHalfT2048.cu b/faiss/gpu/utils/blockselect/BlockSelectHalfT2048.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectHalfT2048.cu rename to faiss/gpu/utils/blockselect/BlockSelectHalfT2048.cu diff --git a/gpu/utils/blockselect/BlockSelectHalfT512.cu b/faiss/gpu/utils/blockselect/BlockSelectHalfT512.cu similarity index 100% rename from gpu/utils/blockselect/BlockSelectHalfT512.cu rename to faiss/gpu/utils/blockselect/BlockSelectHalfT512.cu diff --git a/gpu/utils/blockselect/BlockSelectImpl.cuh b/faiss/gpu/utils/blockselect/BlockSelectImpl.cuh similarity index 100% rename from gpu/utils/blockselect/BlockSelectImpl.cuh rename to faiss/gpu/utils/blockselect/BlockSelectImpl.cuh diff --git a/gpu/utils/nvidia/fp16_emu.cu b/faiss/gpu/utils/nvidia/fp16_emu.cu similarity index 100% rename from gpu/utils/nvidia/fp16_emu.cu rename to faiss/gpu/utils/nvidia/fp16_emu.cu diff --git a/gpu/utils/nvidia/fp16_emu.cuh b/faiss/gpu/utils/nvidia/fp16_emu.cuh similarity index 100% rename from gpu/utils/nvidia/fp16_emu.cuh rename to faiss/gpu/utils/nvidia/fp16_emu.cuh diff --git a/gpu/utils/warpselect/WarpSelectFloat1.cu b/faiss/gpu/utils/warpselect/WarpSelectFloat1.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectFloat1.cu rename to faiss/gpu/utils/warpselect/WarpSelectFloat1.cu diff --git a/gpu/utils/warpselect/WarpSelectFloat128.cu b/faiss/gpu/utils/warpselect/WarpSelectFloat128.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectFloat128.cu rename to faiss/gpu/utils/warpselect/WarpSelectFloat128.cu diff --git a/gpu/utils/warpselect/WarpSelectFloat256.cu b/faiss/gpu/utils/warpselect/WarpSelectFloat256.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectFloat256.cu rename to faiss/gpu/utils/warpselect/WarpSelectFloat256.cu diff --git a/gpu/utils/warpselect/WarpSelectFloat32.cu b/faiss/gpu/utils/warpselect/WarpSelectFloat32.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectFloat32.cu rename to faiss/gpu/utils/warpselect/WarpSelectFloat32.cu diff --git a/gpu/utils/warpselect/WarpSelectFloat64.cu b/faiss/gpu/utils/warpselect/WarpSelectFloat64.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectFloat64.cu rename to faiss/gpu/utils/warpselect/WarpSelectFloat64.cu diff --git a/gpu/utils/warpselect/WarpSelectFloatF1024.cu b/faiss/gpu/utils/warpselect/WarpSelectFloatF1024.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectFloatF1024.cu rename to faiss/gpu/utils/warpselect/WarpSelectFloatF1024.cu diff --git a/gpu/utils/warpselect/WarpSelectFloatF2048.cu b/faiss/gpu/utils/warpselect/WarpSelectFloatF2048.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectFloatF2048.cu rename to faiss/gpu/utils/warpselect/WarpSelectFloatF2048.cu diff --git a/gpu/utils/warpselect/WarpSelectFloatF512.cu b/faiss/gpu/utils/warpselect/WarpSelectFloatF512.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectFloatF512.cu rename to faiss/gpu/utils/warpselect/WarpSelectFloatF512.cu diff --git a/gpu/utils/warpselect/WarpSelectFloatT1024.cu b/faiss/gpu/utils/warpselect/WarpSelectFloatT1024.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectFloatT1024.cu rename to faiss/gpu/utils/warpselect/WarpSelectFloatT1024.cu diff --git a/gpu/utils/warpselect/WarpSelectFloatT2048.cu b/faiss/gpu/utils/warpselect/WarpSelectFloatT2048.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectFloatT2048.cu rename to faiss/gpu/utils/warpselect/WarpSelectFloatT2048.cu diff --git a/gpu/utils/warpselect/WarpSelectFloatT512.cu b/faiss/gpu/utils/warpselect/WarpSelectFloatT512.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectFloatT512.cu rename to faiss/gpu/utils/warpselect/WarpSelectFloatT512.cu diff --git a/gpu/utils/warpselect/WarpSelectHalf1.cu b/faiss/gpu/utils/warpselect/WarpSelectHalf1.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectHalf1.cu rename to faiss/gpu/utils/warpselect/WarpSelectHalf1.cu diff --git a/gpu/utils/warpselect/WarpSelectHalf128.cu b/faiss/gpu/utils/warpselect/WarpSelectHalf128.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectHalf128.cu rename to faiss/gpu/utils/warpselect/WarpSelectHalf128.cu diff --git a/gpu/utils/warpselect/WarpSelectHalf256.cu b/faiss/gpu/utils/warpselect/WarpSelectHalf256.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectHalf256.cu rename to faiss/gpu/utils/warpselect/WarpSelectHalf256.cu diff --git a/gpu/utils/warpselect/WarpSelectHalf32.cu b/faiss/gpu/utils/warpselect/WarpSelectHalf32.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectHalf32.cu rename to faiss/gpu/utils/warpselect/WarpSelectHalf32.cu diff --git a/gpu/utils/warpselect/WarpSelectHalf64.cu b/faiss/gpu/utils/warpselect/WarpSelectHalf64.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectHalf64.cu rename to faiss/gpu/utils/warpselect/WarpSelectHalf64.cu diff --git a/gpu/utils/warpselect/WarpSelectHalfF1024.cu b/faiss/gpu/utils/warpselect/WarpSelectHalfF1024.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectHalfF1024.cu rename to faiss/gpu/utils/warpselect/WarpSelectHalfF1024.cu diff --git a/gpu/utils/warpselect/WarpSelectHalfF2048.cu b/faiss/gpu/utils/warpselect/WarpSelectHalfF2048.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectHalfF2048.cu rename to faiss/gpu/utils/warpselect/WarpSelectHalfF2048.cu diff --git a/gpu/utils/warpselect/WarpSelectHalfF512.cu b/faiss/gpu/utils/warpselect/WarpSelectHalfF512.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectHalfF512.cu rename to faiss/gpu/utils/warpselect/WarpSelectHalfF512.cu diff --git a/gpu/utils/warpselect/WarpSelectHalfT1024.cu b/faiss/gpu/utils/warpselect/WarpSelectHalfT1024.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectHalfT1024.cu rename to faiss/gpu/utils/warpselect/WarpSelectHalfT1024.cu diff --git a/gpu/utils/warpselect/WarpSelectHalfT2048.cu b/faiss/gpu/utils/warpselect/WarpSelectHalfT2048.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectHalfT2048.cu rename to faiss/gpu/utils/warpselect/WarpSelectHalfT2048.cu diff --git a/gpu/utils/warpselect/WarpSelectHalfT512.cu b/faiss/gpu/utils/warpselect/WarpSelectHalfT512.cu similarity index 100% rename from gpu/utils/warpselect/WarpSelectHalfT512.cu rename to faiss/gpu/utils/warpselect/WarpSelectHalfT512.cu diff --git a/gpu/utils/warpselect/WarpSelectImpl.cuh b/faiss/gpu/utils/warpselect/WarpSelectImpl.cuh similarity index 100% rename from gpu/utils/warpselect/WarpSelectImpl.cuh rename to faiss/gpu/utils/warpselect/WarpSelectImpl.cuh diff --git a/impl/AuxIndexStructures.cpp b/faiss/impl/AuxIndexStructures.cpp similarity index 100% rename from impl/AuxIndexStructures.cpp rename to faiss/impl/AuxIndexStructures.cpp diff --git a/impl/AuxIndexStructures.h b/faiss/impl/AuxIndexStructures.h similarity index 100% rename from impl/AuxIndexStructures.h rename to faiss/impl/AuxIndexStructures.h diff --git a/impl/FaissAssert.h b/faiss/impl/FaissAssert.h similarity index 100% rename from impl/FaissAssert.h rename to faiss/impl/FaissAssert.h diff --git a/impl/FaissException.cpp b/faiss/impl/FaissException.cpp similarity index 100% rename from impl/FaissException.cpp rename to faiss/impl/FaissException.cpp diff --git a/impl/FaissException.h b/faiss/impl/FaissException.h similarity index 100% rename from impl/FaissException.h rename to faiss/impl/FaissException.h diff --git a/impl/HNSW.cpp b/faiss/impl/HNSW.cpp similarity index 100% rename from impl/HNSW.cpp rename to faiss/impl/HNSW.cpp diff --git a/impl/HNSW.h b/faiss/impl/HNSW.h similarity index 100% rename from impl/HNSW.h rename to faiss/impl/HNSW.h diff --git a/impl/PolysemousTraining.cpp b/faiss/impl/PolysemousTraining.cpp similarity index 100% rename from impl/PolysemousTraining.cpp rename to faiss/impl/PolysemousTraining.cpp diff --git a/impl/PolysemousTraining.h b/faiss/impl/PolysemousTraining.h similarity index 100% rename from impl/PolysemousTraining.h rename to faiss/impl/PolysemousTraining.h diff --git a/impl/ProductQuantizer-inl.h b/faiss/impl/ProductQuantizer-inl.h similarity index 100% rename from impl/ProductQuantizer-inl.h rename to faiss/impl/ProductQuantizer-inl.h diff --git a/impl/ProductQuantizer.cpp b/faiss/impl/ProductQuantizer.cpp similarity index 100% rename from impl/ProductQuantizer.cpp rename to faiss/impl/ProductQuantizer.cpp diff --git a/impl/ProductQuantizer.h b/faiss/impl/ProductQuantizer.h similarity index 100% rename from impl/ProductQuantizer.h rename to faiss/impl/ProductQuantizer.h diff --git a/impl/ScalarQuantizer.cpp b/faiss/impl/ScalarQuantizer.cpp similarity index 100% rename from impl/ScalarQuantizer.cpp rename to faiss/impl/ScalarQuantizer.cpp diff --git a/impl/ScalarQuantizer.h b/faiss/impl/ScalarQuantizer.h similarity index 100% rename from impl/ScalarQuantizer.h rename to faiss/impl/ScalarQuantizer.h diff --git a/impl/ThreadedIndex-inl.h b/faiss/impl/ThreadedIndex-inl.h similarity index 100% rename from impl/ThreadedIndex-inl.h rename to faiss/impl/ThreadedIndex-inl.h diff --git a/impl/ThreadedIndex.h b/faiss/impl/ThreadedIndex.h similarity index 100% rename from impl/ThreadedIndex.h rename to faiss/impl/ThreadedIndex.h diff --git a/impl/index_read.cpp b/faiss/impl/index_read.cpp similarity index 100% rename from impl/index_read.cpp rename to faiss/impl/index_read.cpp diff --git a/impl/index_write.cpp b/faiss/impl/index_write.cpp similarity index 100% rename from impl/index_write.cpp rename to faiss/impl/index_write.cpp diff --git a/impl/io.cpp b/faiss/impl/io.cpp similarity index 100% rename from impl/io.cpp rename to faiss/impl/io.cpp diff --git a/impl/io.h b/faiss/impl/io.h similarity index 100% rename from impl/io.h rename to faiss/impl/io.h diff --git a/impl/io_macros.h b/faiss/impl/io_macros.h similarity index 100% rename from impl/io_macros.h rename to faiss/impl/io_macros.h diff --git a/impl/lattice_Zn.cpp b/faiss/impl/lattice_Zn.cpp similarity index 100% rename from impl/lattice_Zn.cpp rename to faiss/impl/lattice_Zn.cpp diff --git a/impl/lattice_Zn.h b/faiss/impl/lattice_Zn.h similarity index 100% rename from impl/lattice_Zn.h rename to faiss/impl/lattice_Zn.h diff --git a/index_factory.cpp b/faiss/index_factory.cpp similarity index 100% rename from index_factory.cpp rename to faiss/index_factory.cpp diff --git a/index_factory.h b/faiss/index_factory.h similarity index 100% rename from index_factory.h rename to faiss/index_factory.h diff --git a/index_io.h b/faiss/index_io.h similarity index 100% rename from index_io.h rename to faiss/index_io.h diff --git a/python/Makefile b/faiss/python/Makefile similarity index 65% rename from python/Makefile rename to faiss/python/Makefile index 559d46fef..f2d0d2fa6 100644 --- a/python/Makefile +++ b/faiss/python/Makefile @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. --include ../makefile.inc +-include ../../makefile.inc ifneq ($(strip $(NVCC)),) SWIGFLAGS += -DGPU_WRAPPER @@ -12,18 +12,18 @@ endif all: build # Also silently generates swigfaiss.py. -swigfaiss.cpp: swigfaiss.swig ../libfaiss.a - $(SWIG) -python -c++ -Doverride= -I../ $(SWIGFLAGS) -o $@ $< +swigfaiss.cpp: swigfaiss.swig ../../libfaiss.a + $(SWIG) -python -c++ -Doverride= -I../.. $(SWIGFLAGS) -o $@ $< -swigfaiss_avx2.cpp: swigfaiss.swig ../libfaiss.a - $(SWIG) -python -c++ -Doverride= -module swigfaiss_avx2 -I../ $(SWIGFLAGS) -o $@ $< +swigfaiss_avx2.cpp: swigfaiss.swig ../../libfaiss.a + $(SWIG) -python -c++ -Doverride= -module swigfaiss_avx2 -I../.. $(SWIGFLAGS) -o $@ $< %.o: %.cpp $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CPUFLAGS) $(PYTHONCFLAGS) \ - -I../ -c $< -o $@ + -I../.. -c $< -o $@ # Extension is .so even on OSX. -_%.so: %.o python_callbacks.o ../libfaiss.a +_%.so: %.o python_callbacks.o ../../libfaiss.a $(CXX) $(SHAREDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) build: _swigfaiss.so __init__.py loader.py diff --git a/python/__init__.py b/faiss/python/__init__.py similarity index 100% rename from python/__init__.py rename to faiss/python/__init__.py diff --git a/python/loader.py b/faiss/python/loader.py similarity index 100% rename from python/loader.py rename to faiss/python/loader.py diff --git a/python/python_callbacks.cpp b/faiss/python/python_callbacks.cpp similarity index 100% rename from python/python_callbacks.cpp rename to faiss/python/python_callbacks.cpp diff --git a/python/python_callbacks.h b/faiss/python/python_callbacks.h similarity index 100% rename from python/python_callbacks.h rename to faiss/python/python_callbacks.h diff --git a/python/setup.py b/faiss/python/setup.py similarity index 100% rename from python/setup.py rename to faiss/python/setup.py diff --git a/python/swigfaiss.swig b/faiss/python/swigfaiss.swig similarity index 100% rename from python/swigfaiss.swig rename to faiss/python/swigfaiss.swig diff --git a/utils/Heap.cpp b/faiss/utils/Heap.cpp similarity index 100% rename from utils/Heap.cpp rename to faiss/utils/Heap.cpp diff --git a/utils/Heap.h b/faiss/utils/Heap.h similarity index 100% rename from utils/Heap.h rename to faiss/utils/Heap.h diff --git a/utils/WorkerThread.cpp b/faiss/utils/WorkerThread.cpp similarity index 100% rename from utils/WorkerThread.cpp rename to faiss/utils/WorkerThread.cpp diff --git a/utils/WorkerThread.h b/faiss/utils/WorkerThread.h similarity index 100% rename from utils/WorkerThread.h rename to faiss/utils/WorkerThread.h diff --git a/utils/distances.cpp b/faiss/utils/distances.cpp similarity index 100% rename from utils/distances.cpp rename to faiss/utils/distances.cpp diff --git a/utils/distances.h b/faiss/utils/distances.h similarity index 100% rename from utils/distances.h rename to faiss/utils/distances.h diff --git a/utils/distances_simd.cpp b/faiss/utils/distances_simd.cpp similarity index 100% rename from utils/distances_simd.cpp rename to faiss/utils/distances_simd.cpp diff --git a/utils/extra_distances.cpp b/faiss/utils/extra_distances.cpp similarity index 100% rename from utils/extra_distances.cpp rename to faiss/utils/extra_distances.cpp diff --git a/utils/extra_distances.h b/faiss/utils/extra_distances.h similarity index 100% rename from utils/extra_distances.h rename to faiss/utils/extra_distances.h diff --git a/utils/hamming-inl.h b/faiss/utils/hamming-inl.h similarity index 100% rename from utils/hamming-inl.h rename to faiss/utils/hamming-inl.h diff --git a/utils/hamming.cpp b/faiss/utils/hamming.cpp similarity index 100% rename from utils/hamming.cpp rename to faiss/utils/hamming.cpp diff --git a/utils/hamming.h b/faiss/utils/hamming.h similarity index 100% rename from utils/hamming.h rename to faiss/utils/hamming.h diff --git a/utils/random.cpp b/faiss/utils/random.cpp similarity index 100% rename from utils/random.cpp rename to faiss/utils/random.cpp diff --git a/utils/random.h b/faiss/utils/random.h similarity index 100% rename from utils/random.h rename to faiss/utils/random.h diff --git a/utils/utils.cpp b/faiss/utils/utils.cpp similarity index 100% rename from utils/utils.cpp rename to faiss/utils/utils.cpp diff --git a/utils/utils.h b/faiss/utils/utils.h similarity index 100% rename from utils/utils.h rename to faiss/utils/utils.h diff --git a/gpu/impl/Metrics.cuh b/gpu/impl/Metrics.cuh deleted file mode 100644 index 5b9feac3e..000000000 --- a/gpu/impl/Metrics.cuh +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -namespace faiss { namespace gpu { - -/// List of supported metrics -inline bool isMetricSupported(MetricType mt) { - switch (mt) { - case MetricType::METRIC_INNER_PRODUCT: - case MetricType::METRIC_L2: - return true; - default: - return false; - } -} - -/// Sort direction per each metric -inline bool metricToSortDirection(MetricType mt) { - switch (mt) { - case MetricType::METRIC_INNER_PRODUCT: - // highest - return true; - case MetricType::METRIC_L2: - // lowest - return false; - default: - // unhandled metric - FAISS_ASSERT(false); - return false; - } -} - -struct L2Metric { - static inline __device__ float distance(float a, float b) { - float d = a - b; - return d * d; - } -}; - -struct IPMetric { - static inline __device__ float distance(float a, float b) { - return a * b; - } -}; - -} } // namespace diff --git a/gpu/utils/DeviceMemory.cpp b/gpu/utils/DeviceMemory.cpp deleted file mode 100644 index df00892e3..000000000 --- a/gpu/utils/DeviceMemory.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - -#include -#include -#include - -namespace faiss { namespace gpu { - -DeviceMemoryReservation::DeviceMemoryReservation() - : state_(NULL), - device_(0), - data_(NULL), - size_(0), - stream_(0) { -} - -DeviceMemoryReservation::DeviceMemoryReservation(DeviceMemory* state, - int device, - void* p, - size_t size, - cudaStream_t stream) - : state_(state), - device_(device), - data_(p), - size_(size), - stream_(stream) { -} - -DeviceMemoryReservation::DeviceMemoryReservation( - DeviceMemoryReservation&& m) noexcept { - - state_ = m.state_; - device_ = m.device_; - data_ = m.data_; - size_ = m.size_; - stream_ = m.stream_; - - m.data_ = NULL; -} - -DeviceMemoryReservation::~DeviceMemoryReservation() { - if (data_) { - FAISS_ASSERT(state_); - state_->returnAllocation(*this); - } - - data_ = NULL; -} - -DeviceMemoryReservation& -DeviceMemoryReservation::operator=(DeviceMemoryReservation&& m) { - if (data_) { - FAISS_ASSERT(state_); - state_->returnAllocation(*this); - } - - state_ = m.state_; - device_ = m.device_; - data_ = m.data_; - size_ = m.size_; - stream_ = m.stream_; - - m.data_ = NULL; - - return *this; -} - -DeviceMemory::~DeviceMemory() { -} - -} } // namespace diff --git a/gpu/utils/DeviceMemory.h b/gpu/utils/DeviceMemory.h deleted file mode 100644 index 1bffdc00a..000000000 --- a/gpu/utils/DeviceMemory.h +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - -#pragma once - -#include -#include - -namespace faiss { namespace gpu { - -class DeviceMemory; - -class DeviceMemoryReservation { - public: - DeviceMemoryReservation(); - DeviceMemoryReservation(DeviceMemory* state, - int device, void* p, size_t size, - cudaStream_t stream); - DeviceMemoryReservation(DeviceMemoryReservation&& m) noexcept; - ~DeviceMemoryReservation(); - - DeviceMemoryReservation& operator=(DeviceMemoryReservation&& m); - - int device() { return device_; } - void* get() { return data_; } - size_t size() { return size_; } - cudaStream_t stream() { return stream_; } - - private: - DeviceMemory* state_; - - int device_; - void* data_; - size_t size_; - cudaStream_t stream_; -}; - -/// Manages temporary memory allocations on a GPU device -class DeviceMemory { - public: - virtual ~DeviceMemory(); - - /// Returns the device we are managing memory for - virtual int getDevice() const = 0; - - /// Obtains a temporary memory allocation for our device, - /// whose usage is ordered with respect to the given stream. - virtual DeviceMemoryReservation getMemory(cudaStream_t stream, - size_t size) = 0; - - /// Returns the current size available without calling cudaMalloc - virtual size_t getSizeAvailable() const = 0; - - /// Returns a string containing our current memory manager state - virtual std::string toString() const = 0; - - /// Returns the high-water mark of cudaMalloc allocations for our - /// device - virtual size_t getHighWaterCudaMalloc() const = 0; - - protected: - friend class DeviceMemoryReservation; - virtual void returnAllocation(DeviceMemoryReservation& m) = 0; -}; - -} } // namespace diff --git a/gpu/utils/MemorySpace.cpp b/gpu/utils/MemorySpace.cpp deleted file mode 100644 index 282f83578..000000000 --- a/gpu/utils/MemorySpace.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - -#include -#include -#include - -namespace faiss { namespace gpu { - -/// Allocates CUDA memory for a given memory space -void allocMemorySpaceV(MemorySpace space, void** p, size_t size) { - switch (space) { - case MemorySpace::Device: - { - auto err = cudaMalloc(p, size); - - // Throw if we fail to allocate - FAISS_THROW_IF_NOT_FMT( - err == cudaSuccess, - "failed to cudaMalloc %zu bytes (error %d %s)", - size, (int) err, cudaGetErrorString(err)); - } - break; - case MemorySpace::Unified: - { -#ifdef FAISS_UNIFIED_MEM - auto err = cudaMallocManaged(p, size); - - // Throw if we fail to allocate - FAISS_THROW_IF_NOT_FMT( - err == cudaSuccess, - "failed to cudaMallocManaged %zu bytes (error %d %s)", - size, (int) err, cudaGetErrorString(err)); -#else - FAISS_THROW_MSG("Attempting to allocate via cudaMallocManaged " - "without CUDA 8+ support"); -#endif - } - break; - case MemorySpace::HostPinned: - { - auto err = cudaHostAlloc(p, size, cudaHostAllocDefault); - - // Throw if we fail to allocate - FAISS_THROW_IF_NOT_FMT( - err == cudaSuccess, - "failed to cudaHostAlloc %zu bytes (error %d %s)", - size, (int) err, cudaGetErrorString(err)); - } - break; - default: - FAISS_ASSERT_FMT(false, "unknown MemorySpace %d", (int) space); - break; - } -} - -// We'll allow allocation to fail, but free should always succeed and be a -// fatal error if it doesn't free -void freeMemorySpace(MemorySpace space, void* p) { - switch (space) { - case MemorySpace::Device: - case MemorySpace::Unified: - { - auto err = cudaFree(p); - FAISS_ASSERT_FMT(err == cudaSuccess, - "Failed to cudaFree pointer %p (error %d %s)", - p, (int) err, cudaGetErrorString(err)); - } - break; - case MemorySpace::HostPinned: - { - auto err = cudaFreeHost(p); - FAISS_ASSERT_FMT(err == cudaSuccess, - "Failed to cudaFreeHost pointer %p (error %d %s)", - p, (int) err, cudaGetErrorString(err)); - } - break; - default: - FAISS_ASSERT_FMT(false, "unknown MemorySpace %d", (int) space); - break; - } -} - -} } diff --git a/gpu/utils/MemorySpace.h b/gpu/utils/MemorySpace.h deleted file mode 100644 index f269f06a3..000000000 --- a/gpu/utils/MemorySpace.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - -#pragma once - -#include - -#if CUDA_VERSION >= 8000 -// Whether or not we enable usage of CUDA Unified Memory -#define FAISS_UNIFIED_MEM 1 -#endif - -namespace faiss { namespace gpu { - -enum MemorySpace { - /// Managed using cudaMalloc/cudaFree - Device = 1, - /// Managed using cudaMallocManaged/cudaFree - Unified = 2, - /// Managed using cudaHostAlloc/cudaFreeHost - HostPinned = 3, -}; - -/// All memory allocations and de-allocations come through these functions - -/// Allocates CUDA memory for a given memory space (void pointer) -/// Throws a FaissException if we are unable to allocate the memory -void allocMemorySpaceV(MemorySpace space, void** p, size_t size); - -template -inline void allocMemorySpace(MemorySpace space, T** p, size_t size) { - allocMemorySpaceV(space, (void**)(void*) p, size); -} - -/// Frees CUDA memory for a given memory space -/// Asserts if we are unable to free the region -void freeMemorySpace(MemorySpace space, void* p); - -} }