Blaze 3.9
gemv.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_BLAS_CBLAS_GEMV_H_
36#define _BLAZE_MATH_BLAS_CBLAS_GEMV_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
44#include <blaze/system/BLAS.h>
45#include <blaze/util/Complex.h>
47
48
49namespace blaze {
50
51//=================================================================================================
52//
53// BLAS GENERAL MATRIX/VECTOR MULTIPLICATION FUNCTIONS (GEMV)
54//
55//=================================================================================================
56
57//*************************************************************************************************
60#if BLAZE_BLAS_MODE
61
62void gemv( CBLAS_ORDER layout, CBLAS_TRANSPOSE transA, blas_int_t m, blas_int_t n,
63 float alpha, const float* A, blas_int_t lda, const float* x,
64 blas_int_t incX, float beta, float* y, blas_int_t incY );
65
66void gemv( CBLAS_ORDER layout, CBLAS_TRANSPOSE transA, blas_int_t m, blas_int_t n,
67 double alpha, const double* A, blas_int_t lda, const double* x,
68 blas_int_t incX, double beta, double* y, blas_int_t incY );
69
70void gemv( CBLAS_ORDER layout, CBLAS_TRANSPOSE transA, blas_int_t m, blas_int_t n,
71 complex<float> alpha, const complex<float>* A, blas_int_t lda,
72 const complex<float>* x, blas_int_t incX, complex<float> beta,
73 complex<float>* y, blas_int_t incY );
74
75void gemv( CBLAS_ORDER layout, CBLAS_TRANSPOSE transA, blas_int_t m, blas_int_t n,
76 complex<double> alpha, const complex<double>* A, blas_int_t lda,
77 const complex<double>* x, blas_int_t incX, complex<double> beta,
78 complex<double>* y, blas_int_t incY );
79
80#endif
82//*************************************************************************************************
83
84
85//*************************************************************************************************
86#if BLAZE_BLAS_MODE
112inline void gemv( CBLAS_ORDER order, CBLAS_TRANSPOSE transA, blas_int_t m, blas_int_t n,
113 float alpha, const float* A, blas_int_t lda, const float* x,
114 blas_int_t incX, float beta, float* y, blas_int_t incY )
115{
116 cblas_sgemv( order, transA, m, n, alpha, A, lda, x, incX, beta, y, incY );
117}
118#endif
119//*************************************************************************************************
120
121
122//*************************************************************************************************
123#if BLAZE_BLAS_MODE
149inline void gemv( CBLAS_ORDER order, CBLAS_TRANSPOSE transA, blas_int_t m, blas_int_t n,
150 double alpha, const double* A, blas_int_t lda, const double* x,
151 blas_int_t incX, double beta, double* y, blas_int_t incY )
152{
153 cblas_dgemv( order, transA, m, n, alpha, A, lda, x, incX, beta, y, incY );
154}
155#endif
156//*************************************************************************************************
157
158
159//*************************************************************************************************
160#if BLAZE_BLAS_MODE
186inline void gemv( CBLAS_ORDER order, CBLAS_TRANSPOSE transA, blas_int_t m, blas_int_t n,
187 complex<float> alpha, const complex<float>* A, blas_int_t lda,
188 const complex<float>* x, blas_int_t incX, complex<float> beta,
189 complex<float>* y, blas_int_t incY )
190{
191 BLAZE_STATIC_ASSERT( sizeof( complex<float> ) == 2UL*sizeof( float ) );
192
193 cblas_cgemv( order, transA, m, n, reinterpret_cast<const float*>( &alpha ),
194 reinterpret_cast<const float*>( A ), lda, reinterpret_cast<const float*>( x ),
195 incX, reinterpret_cast<const float*>( &beta ), reinterpret_cast<float*>( y ), incY );
196}
197#endif
198//*************************************************************************************************
199
200
201//*************************************************************************************************
202#if BLAZE_BLAS_MODE
228inline void gemv( CBLAS_ORDER order, CBLAS_TRANSPOSE transA, blas_int_t m, blas_int_t n,
229 complex<double> alpha, const complex<double>* A, blas_int_t lda,
230 const complex<double>* x, blas_int_t incX, complex<double> beta,
231 complex<double>* y, blas_int_t incY )
232{
233 BLAZE_STATIC_ASSERT( sizeof( complex<double> ) == 2UL*sizeof( double ) );
234
235 cblas_zgemv( order, transA, m, n, reinterpret_cast<const double*>( &alpha ),
236 reinterpret_cast<const double*>( A ), lda, reinterpret_cast<const double*>( x ),
237 incX, reinterpret_cast<const double*>( &beta ), reinterpret_cast<double*>( y ), incY );
238}
239#endif
240//*************************************************************************************************
241
242} // namespace blaze
243
244#endif
Header file for the complex data type.
Compile time assertion.
Complex data type of the Blaze library.
int32_t blas_int_t
Signed integer type used in the BLAS/LAPACK wrapper functions.
Definition: Types.h:64
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
Header file for basic BLAS type definitions.
System settings for the BLAS mode.