ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
blas.h
Go to the documentation of this file.
1#ifndef ATEN_KERNELS_BLAS_H_
2#define ATEN_KERNELS_BLAS_H_
3
4#include <ATen/core/tensor.h>
6
8
9namespace container {
10namespace kernels {
11
12template <typename T, typename Device>
13struct blas_copy {
14 // DCOPY copies a vector, x, to a vector, y.
16 const int n,
17 const T *x,
18 const int incx,
19 T *y,
20 const int incy);
21};
22
23template <typename T, typename Device>
24struct blas_nrm2 {
25 using Real = typename GetTypeReal<T>::type;
27 const int n,
28 const T *x,
29 const int incx);
30};
31
32template <typename T, typename Device>
33struct blas_dot {
35 const int& n,
36 const T* x,
37 const int& incx,
38 const T* y,
39 const int& incy,
40 T* result);
41};
42
43
44template <typename T, typename Device>
45struct blas_scal {
47 const int& n,
48 const T* alpha,
49 T* x,
50 const int& incx);
51};
52
53
54template <typename T, typename Device>
55struct blas_axpy {
57 const int& n,
58 const T* alpha,
59 const T* x,
60 const int& incx,
61 T* y,
62 const int& incy);
63};
64
65
66template <typename T, typename Device>
67struct blas_gemv {
69 const char& trans,
70 const int& m,
71 const int& n,
72 const T* alpha,
73 const T* A,
74 const int& lda,
75 const T* x,
76 const int& incx,
77 const T* beta,
78 T* y,
79 const int& incy);
80};
81
82
83template <typename T, typename Device>
86 const char& trans,
87 const int& m,
88 const int& n,
89 const T* alpha,
90 T** A,
91 const int& lda,
92 T** x,
93 const int& incx,
94 const T* beta,
95 T** y,
96 const int& incy,
97 const int& batch_size);
98};
99
100
101template <typename T, typename Device>
104 const char& trans,
105 const int& m,
106 const int& n,
107 const T* alpha,
108 const T* A,
109 const int& lda,
110 const int64_t& stride_a,
111 const T* x,
112 const int& incx,
113 const int64_t& stride_x,
114 const T* beta,
115 T* y,
116 const int& incy,
117 const int64_t& stride_y,
118 const int& batch_size);
119};
120
121
122template <typename T, typename Device>
123struct blas_gemm {
125 const char& transa,
126 const char& transb,
127 const int& m,
128 const int& n,
129 const int& k,
130 const T* alpha,
131 const T* A,
132 const int& lda,
133 const T* B,
134 const int& ldb,
135 const T* beta,
136 T* C,
137 const int& ldc);
138};
139
140
141template <typename T, typename Device>
144 const char& transa,
145 const char& transb,
146 const int& m,
147 const int& n,
148 const int& k,
149 const T* alpha,
150 T** A,
151 const int& lda,
152 T** B,
153 const int& ldb,
154 const T* beta,
155 T** C,
156 const int& ldc,
157 const int& batch_size);
158};
159
160
161template <typename T, typename Device>
164 const char& transa,
165 const char& transb,
166 const int& m,
167 const int& n,
168 const int& k,
169 const T* alpha,
170 const T* A,
171 const int& lda,
172 const int& stride_a,
173 const T* B,
174 const int& ldb,
175 const int& stride_b,
176 const T* beta,
177 T* C,
178 const int& ldc,
179 const int& stride_c,
180 const int& batch_size);
181};
182
183#if __CUDA || __ROCM
184void createGpuBlasHandle(); // create blas handle
185void destroyGpuBlasHandle(); // destory blas handle
186#endif // __CUDA || __UT_USE_CUDA
187
188} // namespace kernels
189} // namespace container
190
191#endif // ATEN_KERNELS_BLAS_H_
#define T
Definition exp.cpp:237
Definition tensor.cpp:8
T type
Definition tensor_types.h:89
Definition blas.h:55
void operator()(const int &n, const T *alpha, const T *x, const int &incx, T *y, const int &incy)
Definition blas.h:13
void operator()(const int n, const T *x, const int incx, T *y, const int incy)
Definition blas.h:33
void operator()(const int &n, const T *x, const int &incx, const T *y, const int &incy, T *result)
void operator()(const char &transa, const char &transb, const int &m, const int &n, const int &k, const T *alpha, const T *A, const int &lda, const int &stride_a, const T *B, const int &ldb, const int &stride_b, const T *beta, T *C, const int &ldc, const int &stride_c, const int &batch_size)
void operator()(const char &transa, const char &transb, const int &m, const int &n, const int &k, const T *alpha, T **A, const int &lda, T **B, const int &ldb, const T *beta, T **C, const int &ldc, const int &batch_size)
Definition blas.h:123
void operator()(const char &transa, const char &transb, const int &m, const int &n, const int &k, const T *alpha, const T *A, const int &lda, const T *B, const int &ldb, const T *beta, T *C, const int &ldc)
void operator()(const char &trans, const int &m, const int &n, const T *alpha, const T *A, const int &lda, const int64_t &stride_a, const T *x, const int &incx, const int64_t &stride_x, const T *beta, T *y, const int &incy, const int64_t &stride_y, const int &batch_size)
void operator()(const char &trans, const int &m, const int &n, const T *alpha, T **A, const int &lda, T **x, const int &incx, const T *beta, T **y, const int &incy, const int &batch_size)
Definition blas.h:67
void operator()(const char &trans, const int &m, const int &n, const T *alpha, const T *A, const int &lda, const T *x, const int &incx, const T *beta, T *y, const int &incy)
Definition blas.h:24
Real operator()(const int n, const T *x, const int incx)
typename GetTypeReal< T >::type Real
Definition blas.h:25
Definition blas.h:45
void operator()(const int &n, const T *alpha, T *x, const int &incx)
This file contains the definition of the DataType enum class.