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