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 // Copyright 2004-present Facebook. All Rights Reserved.
10 
11 #pragma once
12 
13 #include "../GpuIndicesOptions.h"
14 #include "../utils/Tensor.cuh"
15 #include <thrust/device_vector.h>
16 
17 namespace faiss { namespace gpu {
18 
19 /// Update device-side list pointers in a batch
20 void runUpdateListPointers(Tensor<int, 1, true>& listIds,
21  Tensor<int, 1, true>& newListLength,
22  Tensor<void*, 1, true>& newCodePointers,
23  Tensor<void*, 1, true>& newIndexPointers,
24  thrust::device_vector<int>& listLengths,
25  thrust::device_vector<void*>& listCodes,
26  thrust::device_vector<void*>& listIndices,
27  cudaStream_t stream);
28 
29 /// Actually append the new codes / vector indices to the individual lists
30 
31 /// IVFPQ
32 void runIVFPQInvertedListAppend(Tensor<int, 1, true>& listIds,
33  Tensor<int, 1, true>& listOffset,
34  Tensor<int, 2, true>& encodings,
35  Tensor<long, 1, true>& indices,
36  thrust::device_vector<void*>& listCodes,
37  thrust::device_vector<void*>& listIndices,
38  IndicesOptions indicesOptions,
39  cudaStream_t stream);
40 
41 /// IVF flat storage
42 void runIVFFlatInvertedListAppend(Tensor<int, 1, true>& listIds,
43  Tensor<int, 1, true>& listOffset,
44  Tensor<float, 2, true>& vecs,
45  Tensor<long, 1, true>& indices,
46  bool useFloat16,
47  thrust::device_vector<void*>& listData,
48  thrust::device_vector<void*>& listIndices,
49  IndicesOptions indicesOptions,
50  cudaStream_t stream);
51 
52 } } // namespace