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