Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

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