Faiss
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
InvertedListAppend.cuh
1 /**
2  * Copyright (c) Facebook, Inc. and its affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 
9 #pragma once
10 
11 #include "../GpuIndicesOptions.h"
12 #include "../utils/Tensor.cuh"
13 #include <thrust/device_vector.h>
14 
15 namespace faiss { namespace gpu {
16 
17 /// Update device-side list pointers in a batch
18 void runUpdateListPointers(Tensor<int, 1, true>& listIds,
19  Tensor<int, 1, true>& newListLength,
20  Tensor<void*, 1, true>& newCodePointers,
21  Tensor<void*, 1, true>& newIndexPointers,
22  thrust::device_vector<int>& listLengths,
23  thrust::device_vector<void*>& listCodes,
24  thrust::device_vector<void*>& listIndices,
25  cudaStream_t stream);
26 
27 /// Actually append the new codes / vector indices to the individual lists
28 
29 /// IVFPQ
30 void runIVFPQInvertedListAppend(Tensor<int, 1, true>& listIds,
31  Tensor<int, 1, true>& listOffset,
32  Tensor<int, 2, true>& encodings,
33  Tensor<long, 1, true>& indices,
34  thrust::device_vector<void*>& listCodes,
35  thrust::device_vector<void*>& listIndices,
36  IndicesOptions indicesOptions,
37  cudaStream_t stream);
38 
39 /// IVF flat storage
40 void runIVFFlatInvertedListAppend(Tensor<int, 1, true>& listIds,
41  Tensor<int, 1, true>& listOffset,
42  Tensor<float, 2, true>& vecs,
43  Tensor<long, 1, true>& indices,
44  bool useFloat16,
45  thrust::device_vector<void*>& listData,
46  thrust::device_vector<void*>& listIndices,
47  IndicesOptions indicesOptions,
48  cudaStream_t stream);
49 
50 } } // namespace