LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
Elemental_extensions.hpp
Go to the documentation of this file.
1 // Copyright (c) 2014-2023, Lawrence Livermore National Security, LLC.
3 // Produced at the Lawrence Livermore National Laboratory.
4 // Written by the LBANN Research Team (B. Van Essen, et al.) listed in
5 // the CONTRIBUTORS file. <lbann-dev@llnl.gov>
6 //
7 // LLNL-CODE-697807.
8 // All rights reserved.
9 //
10 // This file is part of LBANN: Livermore Big Artificial Neural Network
11 // Toolkit. For details, see http://software.llnl.gov/LBANN or
12 // http://github.com/LBANN.
13 //
14 // Licensed under the Apache License, Version 2.0 (the "Licensee"); you
15 // may not use this file except in compliance with the License. You may
16 // obtain a copy of the License at:
17 //
18 // http://www.apache.org/licenses/LICENSE-2.0
19 //
20 // Unless required by applicable law or agreed to in writing, software
21 // distributed under the License is distributed on an "AS IS" BASIS,
22 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
23 // implied. See the License for the specific language governing
24 // permissions and limitations under the license.
26 
27 #include "El.hpp"
28 
29 namespace El {
30 
31 template <typename F>
32 void ColumnSum(const Matrix<F>& X, Matrix<F>& sums);
33 
34 template <typename F>
35 void ColumnSum(const AbstractMatrix<F>& X, AbstractMatrix<F>& sums);
36 
37 template <typename F>
38 void ColumnSum(const AbstractDistMatrix<F>& A, AbstractDistMatrix<F>& sums);
39 
40 template <typename F>
41 void RowSum(const Matrix<F>& X, Matrix<F>& sums);
42 
43 template <typename F>
44 void RowSum(const AbstractMatrix<F>& X, AbstractMatrix<F>& sums);
45 
46 template <typename F>
47 void RowSum(const AbstractDistMatrix<F>& A, AbstractDistMatrix<F>& sums);
48 
49 template <typename F>
50 void ColumnSummaryStats(const Matrix<F>& X, F& sum, F& min, F& max, F& mean);
51 
52 #define LBANN_PROTO(F) \
53  template void ColumnSum(const Matrix<F>& X, Matrix<F>& norms); \
54  template void RowSum(const Matrix<F>& X, Matrix<F>& norms); \
55  template void ColumnSummaryStats(const Matrix<F>& X, \
56  F& sum, \
57  F& min, \
58  F& max, \
59  F& mean); \
60  template void ColumnSum(const AbstractMatrix<F>& X, \
61  AbstractMatrix<F>& norms); \
62  template void RowSum(const AbstractMatrix<F>& X, AbstractMatrix<F>& norms); \
63  template void ColumnSum(const AbstractDistMatrix<F>& X, \
64  AbstractDistMatrix<F>& sums); \
65  template void RowSum(const AbstractDistMatrix<F>& X, \
66  AbstractDistMatrix<F>& sums);
67 
68 /* #define EL_NO_INT_PROTO */
69 /* #define EL_ENABLE_QUAD */
70 /* #include "El/macros/Instantiate.h" */
71 
72 #ifndef LBANN_PROTO_REAL
73 #define LBANN_PROTO_REAL(T) LBANN_PROTO(T)
74 #endif
75 
76 #ifndef LBANN_PROTO_FLOAT
77 #define LBANN_PROTO_FLOAT LBANN_PROTO_REAL(float)
78 #endif
79 #ifndef LBANN_PROTO_DOUBLE
80 #define LBANN_PROTO_DOUBLE LBANN_PROTO_REAL(double)
81 #endif
82 
83 } // namespace El
void RowSum(const Matrix< F > &X, Matrix< F > &sums)
void ColumnSummaryStats(const Matrix< F > &X, F &sum, F &min, F &max, F &mean)
void ColumnSum(const Matrix< F > &X, Matrix< F > &sums)