1- #include " module_base/ blas_connector.h"
1+ #include " blas_connector.h"
22
3- inline
43void 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
108void 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
1613void 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
2218void 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
3025void BlasConnector::scal ( const int n, const float alpha, float *X, const int incX)
3126{
3227 sscal_ (&n, &alpha, X, &incX);
3328}
3429
35- inline
3630void 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+
4235void 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
4840void 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
5647float 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+
6152double 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
6858void 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
7867void 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
8876void 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
9885void 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
10894void 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
116101void 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
124108void 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
134117float BlasConnector::nrm2 ( const int n, const float *X, const int incX )
135118{
136119 return snrm2_ ( &n, X, &incX );
137120}
138121
139- inline
122+
140123double BlasConnector::nrm2 ( const int n, const double *X, const int incX )
141124{
142125 return dnrm2_ ( &n, X, &incX );
143126}
144127
145- inline
128+
146129double 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
153135void 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
159140void 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);
0 commit comments