Skip to content

Commit f8937b2

Browse files
committed
Remove inline keyword
1 parent 03a4bda commit f8937b2

File tree

2 files changed

+28
-47
lines changed

2 files changed

+28
-47
lines changed

source/module_base/blas_connector.cpp

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,60 @@
1-
#include "module_base/blas_connector.h"
1+
#include "blas_connector.h"
22

3-
inline
43
void BlasConnector::axpy( const int n, const float alpha, const float *X, const int incX, float *Y, const int incY)
54
{
65
saxpy_(&n, &alpha, X, &incX, Y, &incY);
76
}
87

9-
inline
108
void BlasConnector::axpy( const int n, const double alpha, const double *X, const int incX, double *Y, const int incY)
119
{
1210
daxpy_(&n, &alpha, X, &incX, Y, &incY);
1311
}
1412

15-
inline
1613
void BlasConnector::axpy( const int n, const std::complex<float> alpha, const std::complex<float> *X, const int incX, std::complex<float> *Y, const int incY)
1714
{
1815
caxpy_(&n, &alpha, X, &incX, Y, &incY);
1916
}
2017

21-
inline
2218
void BlasConnector::axpy( const int n, const std::complex<double> alpha, const std::complex<double> *X, const int incX, std::complex<double> *Y, const int incY)
2319
{
2420
zaxpy_(&n, &alpha, X, &incX, Y, &incY);
2521
}
2622

2723

2824
// x=a*x
29-
inline
3025
void BlasConnector::scal( const int n, const float alpha, float *X, const int incX)
3126
{
3227
sscal_(&n, &alpha, X, &incX);
3328
}
3429

35-
inline
3630
void BlasConnector::scal( const int n, const double alpha, double *X, const int incX)
3731
{
3832
dscal_(&n, &alpha, X, &incX);
3933
}
40-
41-
inline
34+
4235
void BlasConnector::scal( const int n, const std::complex<float> alpha, std::complex<float> *X, const int incX)
4336
{
4437
cscal_(&n, &alpha, X, &incX);
4538
}
4639

47-
inline
4840
void BlasConnector::scal( const int n, const std::complex<double> alpha, std::complex<double> *X, const int incX)
4941
{
5042
zscal_(&n, &alpha, X, &incX);
5143
}
5244

5345

5446
// d=x*y
55-
inline
5647
float BlasConnector::dot( const int n, const float *X, const int incX, const float *Y, const int incY)
5748
{
5849
return sdot_(&n, X, &incX, Y, &incY);
5950
}
60-
inline
51+
6152
double BlasConnector::dot( const int n, const double *X, const int incX, const double *Y, const int incY)
6253
{
6354
return ddot_(&n, X, &incX, Y, &incY);
6455
}
6556

6657
// C = a * A.? * B.? + b * C
67-
inline
6858
void BlasConnector::gemm(const char transa, const char transb, const int m, const int n, const int k,
6959
const float alpha, const float *a, const int lda, const float *b, const int ldb,
7060
const float beta, float *c, const int ldc)
@@ -74,7 +64,6 @@ void BlasConnector::gemm(const char transa, const char transb, const int m, cons
7464
&beta, c, &ldc);
7565
}
7666

77-
inline
7867
void BlasConnector::gemm(const char transa, const char transb, const int m, const int n, const int k,
7968
const double alpha, const double *a, const int lda, const double *b, const int ldb,
8069
const double beta, double *c, const int ldc)
@@ -84,7 +73,6 @@ void BlasConnector::gemm(const char transa, const char transb, const int m, cons
8473
&beta, c, &ldc);
8574
}
8675

87-
inline
8876
void BlasConnector::gemm(const char transa, const char transb, const int m, const int n, const int k,
8977
const std::complex<float> alpha, const std::complex<float> *a, const int lda, const std::complex<float> *b, const int ldb,
9078
const std::complex<float> beta, std::complex<float> *c, const int ldc)
@@ -94,7 +82,6 @@ void BlasConnector::gemm(const char transa, const char transb, const int m, cons
9482
&beta, c, &ldc);
9583
}
9684

97-
inline
9885
void BlasConnector::gemm(const char transa, const char transb, const int m, const int n, const int k,
9986
const std::complex<double> alpha, const std::complex<double> *a, const int lda, const std::complex<double> *b, const int ldb,
10087
const std::complex<double> beta, std::complex<double> *c, const int ldc)
@@ -104,23 +91,20 @@ void BlasConnector::gemm(const char transa, const char transb, const int m, cons
10491
&beta, c, &ldc);
10592
}
10693

107-
inline
10894
void BlasConnector::gemv(const char trans, const int m, const int n,
10995
const double alpha, const double* A, const int lda, const double* X, const int incx,
11096
const double beta, double* Y, const int incy)
11197
{
11298
dgemv_(&trans, &m, &n, &alpha, A, &lda, X, &incx, &beta, Y, &incy);
11399
}
114100

115-
inline
116101
void BlasConnector::gemv(const char trans, const int m, const int n,
117102
const std::complex<float> alpha, const std::complex<float> *A, const int lda, const std::complex<float> *X, const int incx,
118103
const std::complex<float> beta, std::complex<float> *Y, const int incy)
119104
{
120105
cgemv_(&trans, &m, &n, &alpha, A, &lda, X, &incx, &beta, Y, &incy);
121106
}
122107

123-
inline
124108
void BlasConnector::gemv(const char trans, const int m, const int n,
125109
const std::complex<double> alpha, const std::complex<double> *A, const int lda, const std::complex<double> *X, const int incx,
126110
const std::complex<double> beta, std::complex<double> *Y, const int incy)
@@ -130,32 +114,29 @@ void BlasConnector::gemv(const char trans, const int m, const int n,
130114

131115

132116
// out = ||x||_2
133-
inline
134117
float BlasConnector::nrm2( const int n, const float *X, const int incX )
135118
{
136119
return snrm2_( &n, X, &incX );
137120
}
138121

139-
inline
122+
140123
double BlasConnector::nrm2( const int n, const double *X, const int incX )
141124
{
142125
return dnrm2_( &n, X, &incX );
143126
}
144127

145-
inline
128+
146129
double BlasConnector::nrm2( const int n, const std::complex<double> *X, const int incX )
147130
{
148131
return dznrm2_( &n, X, &incX );
149132
}
150133

151134
// copies a into b
152-
inline
153135
void BlasConnector::copy(const long n, const double *a, const int incx, double *b, const int incy)
154136
{
155137
dcopy_(&n, a, &incx, b, &incy);
156138
}
157139

158-
inline
159140
void BlasConnector::copy(const long n, const std::complex<double> *a, const int incx, std::complex<double> *b, const int incy)
160141
{
161142
zcopy_(&n, a, &incx, b, &incy);

source/module_base/blas_connector.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -118,98 +118,98 @@ class BlasConnector
118118

119119
// Peize Lin add 2016-08-04
120120
// y=a*x+y
121-
static inline
121+
static
122122
void axpy( const int n, const float alpha, const float *X, const int incX, float *Y, const int incY);
123123

124-
static inline
124+
static
125125
void axpy( const int n, const double alpha, const double *X, const int incX, double *Y, const int incY);
126126

127-
static inline
127+
static
128128
void axpy( const int n, const std::complex<float> alpha, const std::complex<float> *X, const int incX, std::complex<float> *Y, const int incY);
129129

130-
static inline
130+
static
131131
void axpy( const int n, const std::complex<double> alpha, const std::complex<double> *X, const int incX, std::complex<double> *Y, const int incY);
132132

133133

134134
// Peize Lin add 2016-08-04
135135
// x=a*x
136-
static inline
136+
static
137137
void scal( const int n, const float alpha, float *X, const int incX);
138138

139-
static inline
139+
static
140140
void scal( const int n, const double alpha, double *X, const int incX);
141141

142-
static inline
142+
static
143143
void scal( const int n, const std::complex<float> alpha, std::complex<float> *X, const int incX);
144144

145-
static inline
145+
static
146146
void scal( const int n, const std::complex<double> alpha, std::complex<double> *X, const int incX);
147147

148148

149149
// Peize Lin add 2017-10-27
150150
// d=x*y
151-
static inline
151+
static
152152
float dot( const int n, const float *X, const int incX, const float *Y, const int incY);
153153

154-
static inline
154+
static
155155
double dot( const int n, const double *X, const int incX, const double *Y, const int incY);
156156

157157

158158
// Peize Lin add 2017-10-27, fix bug trans 2019-01-17
159159
// C = a * A.? * B.? + b * C
160-
static inline
160+
static
161161
void gemm(const char transa, const char transb, const int m, const int n, const int k,
162162
const float alpha, const float *a, const int lda, const float *b, const int ldb,
163163
const float beta, float *c, const int ldc);
164164

165-
static inline
165+
static
166166
void gemm(const char transa, const char transb, const int m, const int n, const int k,
167167
const double alpha, const double *a, const int lda, const double *b, const int ldb,
168168
const double beta, double *c, const int ldc);
169169

170-
static inline
170+
static
171171
void gemm(const char transa, const char transb, const int m, const int n, const int k,
172172
const std::complex<float> alpha, const std::complex<float> *a, const int lda, const std::complex<float> *b, const int ldb,
173173
const std::complex<float> beta, std::complex<float> *c, const int ldc);
174174

175-
static inline
175+
static
176176
void gemm(const char transa, const char transb, const int m, const int n, const int k,
177177
const std::complex<double> alpha, const std::complex<double> *a, const int lda, const std::complex<double> *b, const int ldb,
178178
const std::complex<double> beta, std::complex<double> *c, const int ldc);
179179

180-
static inline
180+
static
181181
void gemv(const char trans, const int m, const int n,
182182
const double alpha, const double* A, const int lda, const double* X, const int incx,
183183
const double beta, double* Y, const int incy);
184184

185-
static inline
185+
static
186186
void gemv(const char trans, const int m, const int n,
187187
const std::complex<float> alpha, const std::complex<float> *A, const int lda, const std::complex<float> *X, const int incx,
188188
const std::complex<float> beta, std::complex<float> *Y, const int incy);
189189

190-
static inline
190+
static
191191
void gemv(const char trans, const int m, const int n,
192192
const std::complex<double> alpha, const std::complex<double> *A, const int lda, const std::complex<double> *X, const int incx,
193193
const std::complex<double> beta, std::complex<double> *Y, const int incy);
194194

195195

196196
// Peize Lin add 2018-06-12
197197
// out = ||x||_2
198-
static inline
198+
static
199199
float nrm2( const int n, const float *X, const int incX );
200200

201-
static inline
201+
static
202202
double nrm2( const int n, const double *X, const int incX );
203203

204-
static inline
204+
static
205205
double nrm2( const int n, const std::complex<double> *X, const int incX );
206206

207207

208208
// copies a into b
209-
static inline
209+
static
210210
void copy(const long n, const double *a, const int incx, double *b, const int incy);
211211

212-
static inline
212+
static
213213
void copy(const long n, const std::complex<double> *a, const int incx, std::complex<double> *b, const int incy);
214214
};
215215

@@ -258,4 +258,4 @@ void zgemv_i(const char *trans,
258258
*/
259259

260260
#endif // GATHER_INFO
261-
#endif // BLAS_CONNECTOR_H
261+
#endif // BLAS_CONNECTOR_H

0 commit comments

Comments
 (0)