Faiss
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
BroadcastSum.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 "../utils/Float16.cuh"
14 #include "../utils/Tensor.cuh"
15 
16 namespace faiss { namespace gpu {
17 
18 // output[x][i] += input[i] for all x
19 void runSumAlongColumns(Tensor<float, 1, true>& input,
20  Tensor<float, 2, true>& output,
21  cudaStream_t stream);
22 
23 #ifdef FAISS_USE_FLOAT16
24 void runSumAlongColumns(Tensor<half, 1, true>& input,
25  Tensor<half, 2, true>& output,
26  cudaStream_t stream);
27 #endif
28 
29 // output[x][i] = input[i] for all x
30 void runAssignAlongColumns(Tensor<float, 1, true>& input,
31  Tensor<float, 2, true>& output,
32  cudaStream_t stream);
33 
34 #ifdef FAISS_USE_FLOAT16
35 void runAssignAlongColumns(Tensor<half, 1, true>& input,
36  Tensor<half, 2, true>& output,
37  cudaStream_t stream);
38 #endif
39 
40 // output[i][x] += input[i] for all x
41 void runSumAlongRows(Tensor<float, 1, true>& input,
42  Tensor<float, 2, true>& output,
43  cudaStream_t stream);
44 
45 #ifdef FAISS_USE_FLOAT16
46 void runSumAlongRows(Tensor<half, 1, true>& input,
47  Tensor<half, 2, true>& output,
48  cudaStream_t stream);
49 #endif
50 
51 } } // namespace