Faiss
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
PQScanMultiPassNoPrecomputed.cuh
1 
2 /**
3  * Copyright (c) 2015-present, Facebook, Inc.
4  * All rights reserved.
5  *
6  * This source code is licensed under the CC-by-NC license found in the
7  * LICENSE file in the root directory of this source tree.
8  */
9 
10 // Copyright 2004-present Facebook. All Rights Reserved.
11 
12 #pragma once
13 
14 #include "../GpuIndicesOptions.h"
15 #include "../utils/Tensor.cuh"
16 #include <thrust/device_vector.h>
17 
18 namespace faiss { namespace gpu {
19 
20 class GpuResources;
21 
22 /// For no precomputed codes, is this a supported number of dimensions
23 /// per subquantizer?
24 bool isSupportedNoPrecomputedSubDimSize(int dims);
25 
26 void runPQScanMultiPassNoPrecomputed(Tensor<float, 2, true>& queries,
27  Tensor<float, 2, true>& centroids,
28  Tensor<float, 3, true>& pqCentroidsInnermostCode,
29  Tensor<int, 2, true>& topQueryToCentroid,
30  bool useFloat16Lookup,
31  int bytesPerCode,
32  int numSubQuantizers,
33  int numSubQuantizerCodes,
34  thrust::device_vector<void*>& listCodes,
35  thrust::device_vector<void*>& listIndices,
36  IndicesOptions indicesOptions,
37  thrust::device_vector<int>& listLengths,
38  int maxListLength,
39  int k,
40  // output
41  Tensor<float, 2, true>& outDistances,
42  // output
43  Tensor<long, 2, true>& outIndices,
44  GpuResources* res);
45 
46 } } // namespace