Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
VectorResidual.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 "../utils/Tensor.cuh"
15 #include "../utils/Float16.cuh"
16
17 namespace faiss { namespace gpu {
18
19 // Calculates residual v_i - c_j for all v_i in vecs where j = vecToCentroid[i]
20 void runCalcResidual(Tensor<float, 2, true>& vecs,
21 Tensor<float, 2, true>& centroids,
22 Tensor<int, 1, true>& vecToCentroid,
23 Tensor<float, 2, true>& residuals,
24 cudaStream_t stream);
25
26 #ifdef FAISS_USE_FLOAT16
27 void runCalcResidual(Tensor<float, 2, true>& vecs,
28 Tensor<half, 2, true>& centroids,
29 Tensor<int, 1, true>& vecToCentroid,
30 Tensor<float, 2, true>& residuals,
31 cudaStream_t stream);
32 #endif
33
34 } } // namespace