Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
blas
cblas
dotu.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_BLAS_CBLAS_DOTU_H_
36
#define _BLAZE_MATH_BLAS_CBLAS_DOTU_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 DOT PRODUCT (DOTU)
54
//
55
//=================================================================================================
56
57
//*************************************************************************************************
60
#if BLAZE_BLAS_MODE
61
62
float
dotu
(
blas_int_t
n,
const
float
* x,
blas_int_t
incX,
const
float
* y,
blas_int_t
incY );
63
64
double
dotu
(
blas_int_t
n,
const
double
* x,
blas_int_t
incX,
const
double
* y,
blas_int_t
incY );
65
66
complex<float>
dotu
(
blas_int_t
n,
const
complex<float>* x,
blas_int_t
incX,
67
const
complex<float>* y,
blas_int_t
incY );
68
69
complex<double>
dotu
(
blas_int_t
n,
const
complex<double>* x,
blas_int_t
incX,
70
const
complex<double>* y,
blas_int_t
incY );
71
72
#endif
74
//*************************************************************************************************
75
76
77
//*************************************************************************************************
78
#if BLAZE_BLAS_MODE
97
inline
float
dotu
(
blas_int_t
n,
const
float
* x,
blas_int_t
incX,
const
float
* y,
blas_int_t
incY )
98
{
99
return
cblas_sdot( n, x, incX, y, incY );
100
}
101
#endif
102
//*************************************************************************************************
103
104
105
//*************************************************************************************************
106
#if BLAZE_BLAS_MODE
125
inline
double
dotu
(
blas_int_t
n,
const
double
* x,
blas_int_t
incX,
const
double
* y,
blas_int_t
incY )
126
{
127
return
cblas_ddot( n, x, incX, y, incY );
128
}
129
#endif
130
//*************************************************************************************************
131
132
133
//*************************************************************************************************
134
#if BLAZE_BLAS_MODE
153
inline
complex<float>
dotu
(
blas_int_t
n,
const
complex<float>* x,
blas_int_t
incX,
154
const
complex<float>* y,
blas_int_t
incY )
155
{
156
BLAZE_STATIC_ASSERT
(
sizeof
( complex<float> ) == 2UL*
sizeof
(
float
) );
157
158
complex<float> tmp;
159
160
#ifdef OPENBLAS_VERSION
161
cblas_cdotu_sub( n,
reinterpret_cast<
const
float
*
>
( x ), incX,
162
reinterpret_cast<
const
float
*
>
( y ), incY,
163
reinterpret_cast<
openblas_complex_float*
>
( &tmp ) );
164
#else
165
cblas_cdotu_sub( n,
reinterpret_cast<
const
float
*
>
( x ), incX,
166
reinterpret_cast<
const
float
*
>
( y ), incY, &tmp );
167
#endif
168
169
return
tmp;
170
}
171
#endif
172
//*************************************************************************************************
173
174
175
//*************************************************************************************************
176
#if BLAZE_BLAS_MODE
195
inline
complex<double>
dotu
(
blas_int_t
n,
const
complex<double>* x,
blas_int_t
incX,
196
const
complex<double>* y,
blas_int_t
incY )
197
{
198
BLAZE_STATIC_ASSERT
(
sizeof
( complex<double> ) == 2UL*
sizeof
(
double
) );
199
200
complex<double> tmp;
201
202
#ifdef OPENBLAS_VERSION
203
cblas_zdotu_sub( n,
reinterpret_cast<
const
double
*
>
( x ), incX,
204
reinterpret_cast<
const
double
*
>
( y ), incY,
205
reinterpret_cast<
openblas_complex_double*
>
( &tmp ) );
206
#else
207
cblas_zdotu_sub( n,
reinterpret_cast<
const
double
*
>
( x ), incX,
208
reinterpret_cast<
const
double
*
>
( y ), incY, &tmp );
209
#endif
210
211
return
tmp;
212
}
213
#endif
214
//*************************************************************************************************
215
216
}
// namespace blaze
217
218
#endif
Complex.h
Header file for the complex data type.
StaticAssert.h
Compile time assertion.
blaze::dotu
ElementType_t< VT1 > dotu(const DenseVector< VT1, TF1 > &x, const DenseVector< VT2, TF2 > &y)
BLAS kernel for a dense vector dot product ( ).
Definition
dotu.h:88
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