Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
blas
cblas
axpy.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_BLAS_CBLAS_AXPY_H_
36
#define _BLAZE_MATH_BLAS_CBLAS_AXPY_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/math/blas/Types.h
>
44
#include <
blaze/system/BLAS.h
>
45
#include <
blaze/util/Complex.h
>
46
#include <
blaze/util/StaticAssert.h
>
47
48
49
namespace
blaze {
50
51
//=================================================================================================
52
//
53
// BLAS SCALED VECTOR ADDITION (AXPY)
54
//
55
//=================================================================================================
56
57
//*************************************************************************************************
60
#if BLAZE_BLAS_MODE
61
62
void
axpy
(
blas_int_t
n,
float
alpha,
const
float
* x,
blas_int_t
incX,
63
float
* y,
blas_int_t
incY );
64
65
void
axpy
(
blas_int_t
n,
double
alpha,
const
double
* x,
blas_int_t
incX,
66
double
* y,
blas_int_t
incY );
67
68
void
axpy
(
blas_int_t
n, complex<float> alpha,
const
complex<float>* x,
blas_int_t
incX,
69
complex<float>* y,
blas_int_t
incY );
70
71
void
axpy
(
blas_int_t
n, complex<double> alpha,
const
complex<double>* x,
blas_int_t
incX,
72
complex<double>* y,
blas_int_t
incY );
73
74
#endif
76
//*************************************************************************************************
77
78
79
//*************************************************************************************************
80
#if BLAZE_BLAS_MODE
100
inline
void
axpy
(
blas_int_t
n,
float
alpha,
const
float
* x,
blas_int_t
incX,
101
float
* y,
blas_int_t
incY )
102
{
103
cblas_saxpy( n, alpha, x, incX, y, incY );
104
}
105
#endif
106
//*************************************************************************************************
107
108
109
//*************************************************************************************************
110
#if BLAZE_BLAS_MODE
130
inline
void
axpy
(
blas_int_t
n,
double
alpha,
const
double
* x,
blas_int_t
incX,
131
double
* y,
blas_int_t
incY )
132
{
133
cblas_daxpy( n, alpha, x, incX, y, incY );
134
}
135
#endif
136
//*************************************************************************************************
137
138
139
//*************************************************************************************************
140
#if BLAZE_BLAS_MODE
160
inline
void
axpy
(
blas_int_t
n, complex<float> alpha,
const
complex<float>* x,
blas_int_t
incX,
161
complex<float>* y,
blas_int_t
incY )
162
{
163
BLAZE_STATIC_ASSERT
(
sizeof
( complex<float> ) == 2UL*
sizeof
(
float
) );
164
165
cblas_caxpy( n,
reinterpret_cast<
const
float
*
>
( &alpha ),
166
reinterpret_cast<
const
float
*
>
( x ), incX,
reinterpret_cast<
float
*
>
( y ), incY );
167
}
168
#endif
169
//*************************************************************************************************
170
171
172
//*************************************************************************************************
173
#if BLAZE_BLAS_MODE
193
inline
void
axpy
(
blas_int_t
n, complex<double> alpha,
const
complex<double>* x,
blas_int_t
incX,
194
complex<double>* y,
blas_int_t
incY )
195
{
196
BLAZE_STATIC_ASSERT
(
sizeof
( complex<double> ) == 2UL*
sizeof
(
double
) );
197
198
cblas_zaxpy( n,
reinterpret_cast<
const
double
*
>
( &alpha ),
199
reinterpret_cast<
const
double
*
>
( x ), incX,
reinterpret_cast<
double
*
>
( y ), incY );
200
}
201
#endif
202
//*************************************************************************************************
203
204
}
// namespace blaze
205
206
#endif
Complex.h
Header file for the complex data type.
StaticAssert.h
Compile time assertion.
blaze::axpy
void axpy(DenseVector< VT1, TF1 > &x, const DenseVector< VT2, TF2 > &y, ST alpha)
BLAS kernel for a dense vector axpy product ( ).
Definition
axpy.h:90
blaze::blas_int_t
int32_t blas_int_t
Signed integer type used in the BLAS/LAPACK wrapper functions.
Definition
Types.h:64
BLAZE_STATIC_ASSERT
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition
StaticAssert.h:112
Types.h
Header file for basic BLAS type definitions.
BLAS.h
System settings for the BLAS mode.
Generated by
1.18.0