Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
InvertedListAppend.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 /// Update device-side list pointers in a batch
21 void runUpdateListPointers(Tensor<int, 1, true>& listIds,
22 Tensor<int, 1, true>& newListLength,
23 Tensor<void*, 1, true>& newCodePointers,
24 Tensor<void*, 1, true>& newIndexPointers,
25 thrust::device_vector<int>& listLengths,
26 thrust::device_vector<void*>& listCodes,
27 thrust::device_vector<void*>& listIndices,
28 cudaStream_t stream);
29
30 /// Actually append the new codes / vector indices to the individual lists
31
32 /// IVFPQ
33 void runIVFPQInvertedListAppend(Tensor<int, 1, true>& listIds,
34 Tensor<int, 1, true>& listOffset,
35 Tensor<int, 2, true>& encodings,
36 Tensor<long, 1, true>& indices,
37 thrust::device_vector<void*>& listCodes,
38 thrust::device_vector<void*>& listIndices,
39 IndicesOptions indicesOptions,
40 cudaStream_t stream);
41
42 /// IVF flat storage
43 void runIVFFlatInvertedListAppend(Tensor<int, 1, true>& listIds,
44 Tensor<int, 1, true>& listOffset,
45 Tensor<float, 2, true>& vecs,
46 Tensor<long, 1, true>& indices,
47 bool useFloat16,
48 thrust::device_vector<void*>& listData,
49 thrust::device_vector<void*>& listIndices,
50 IndicesOptions indicesOptions,
51 cudaStream_t stream);
52
53 } } // namespace