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