Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#pragma once
#ifdef HAVE_CUDA
#ifdef HAVE_BLAS
#include <cblas.h>
inline int blasIgamax( int n, const float *x, int incx )
{
return cblas_isamax( n, x, incx );
}
inline int blasIgamax( int n, const double *x, int incx )
{
return cblas_idamax( n, x, incx );
}
inline int blasIgamin( int n, const float *x, int incx )
{
return cblas_Isamin( n, x, incx );
}
inline int blasIgamin( int n, const double *x, int incx )
{
return cblas_Idamin( n, x, incx );
}
inline float blasGasum( int n, const float *x, int incx )
{
return cblas_sasum( n, x, incx );
}
inline double blasGasum( int n, const double *x, int incx )
{
return cblas_dasum( n, x, incx );
}
inline void
blasGaxpy( int n, const float *alpha,
const float *x, int incx,
float *y, int incy )
{
cblas_saxpy( n, alpha, x, incx, y, incy );
}
inline blasStatus_t
blasGaxpy( blasHandle_t int n,
const double *alpha,
const double *x, int incx,
double *y, int incy )
{
return cblas_Daxpy( n, alpha, x, incx, y, incy );
}
inline blasStatus_t
blasGdot( blasHandle_t int n,
const float *x, int incx,
const float *y, int incy,
float *result )
{
return cblas_Sdot( n, x, incx, y, incy, result );
}
inline blasStatus_t
blasGdot( blasHandle_t int n,
const double *x, int incx,
const double *y, int incy,
double *result )
{
return cblas_Ddot( n, x, incx, y, incy, result );
}
inline blasStatus_t
blasGnrm2( blasHandle_t int n,
const float *x, int incx, float *result )
{
return cblas_Snrm2( n, x, incx, result );
}
inline blasStatus_t
blasGnrm2( blasHandle_t int n,
const double *x, int incx, double *result )
{
return cblas_Dnrm2( n, x, incx, result );
}
inline blasStatus_t
blasGscal( blasHandle_t int n,
const float *alpha,
float *x, int incx )
{
return cblas_Sscal( n, alpha, x, incx );
}
inline blasStatus_t
blasGscal( blasHandle_t int n,
const double *alpha,
double *x, int incx )
{
return cblas_Dscal( n, alpha, x, incx );
}
#endif
#endif