@@ -57,6 +57,18 @@ namespace hsolver
5757
5858template <typename FPTYPE, typename Device>
5959struct zdot_real_op {
60+ // / @brief zdot_real_op computes the dot product of the given complex arrays(treated as float arrays).
61+ // / And there's may have MPI communications while enabling planewave parallization strategy.
62+ // /
63+ // / Input Parameters
64+ // / \param d : the type of computing device
65+ // / \param dim : array size
66+ // / \param psi_L : input array A
67+ // / \param psi_R : input array B
68+ // / \param reduce : flag to control whether to perform the MPI communications
69+ // /
70+ // / \return
71+ // / FPTYPE : dot product result
6072 FPTYPE operator () (
6173 const Device* d,
6274 const int & dim,
@@ -68,6 +80,16 @@ struct zdot_real_op {
6880// vector operator: result[i] = vector[i] / constant
6981template <typename FPTYPE, typename Device> struct vector_div_constant_op
7082{
83+ // / @brief result[i] = vector[i] / constant
84+ // /
85+ // / Input Parameters
86+ // / \param d : the type of computing device
87+ // / \param dim : array size
88+ // / \param vector : input array
89+ // / \param constant : input constant
90+ // /
91+ // / Output Parameters
92+ // / \param result : output array
7193 void operator ()(const Device* d,
7294 const int dim,
7395 std::complex <FPTYPE>* result,
@@ -78,6 +100,17 @@ template <typename FPTYPE, typename Device> struct vector_div_constant_op
78100// replace vector_div_constant_op : x = alpha * x
79101template <typename FPTYPE, typename Device> struct scal_op
80102{
103+ // / @brief x = alpha * x
104+ // /
105+ // / Input Parameters
106+ // / \param d : the type of computing device
107+ // / \param N : array size
108+ // / \param alpha : input constant
109+ // / \param X : input array
110+ // / \param incx : computing strip of array X
111+ // /
112+ // / Output Parameters
113+ // / \param X : output array
81114 void operator ()(const Device* d,
82115 const int & N,
83116 const std::complex <FPTYPE>* alpha,
@@ -88,6 +121,16 @@ template <typename FPTYPE, typename Device> struct scal_op
88121// vector operator: result[i] = vector1[i](complex) * vector2[i](not complex)
89122template <typename FPTYPE, typename Device> struct vector_mul_vector_op
90123{
124+ // / @brief result[i] = vector1[i](complex) * vector2[i](not complex)
125+ // /
126+ // / Input Parameters
127+ // / \param d : the type of computing device
128+ // / \param dim : array size
129+ // / \param vector1 : input array A
130+ // / \param vector2 : input array B
131+ // /
132+ // / Output Parameters
133+ // / \param result : output array
91134 void operator ()(const Device* d,
92135 const int & dim,
93136 std::complex <FPTYPE>* result,
@@ -98,6 +141,16 @@ template <typename FPTYPE, typename Device> struct vector_mul_vector_op
98141// vector operator: result[i] = vector1[i](complex) / vector2[i](not complex)
99142template <typename FPTYPE, typename Device> struct vector_div_vector_op
100143{
144+ // / @brief result[i] = vector1[i](complex) / vector2[i](not complex)
145+ // /
146+ // / Input Parameters
147+ // / \param d : the type of computing device
148+ // / \param dim : array size
149+ // / \param vector1 : input array A
150+ // / \param vector2 : input array B
151+ // /
152+ // / Output Parameters
153+ // / \param result : output array
101154 void operator ()(const Device* d,
102155 const int & dim,
103156 std::complex <FPTYPE>* result,
@@ -108,6 +161,18 @@ template <typename FPTYPE, typename Device> struct vector_div_vector_op
108161// vector operator: result[i] = vector1[i] * constant1 + vector2[i] * constant2
109162template <typename FPTYPE, typename Device> struct constantvector_addORsub_constantVector_op
110163{
164+ // / @brief result[i] = vector1[i] * constant1 + vector2[i] * constant2
165+ // /
166+ // / Input Parameters
167+ // / \param d : the type of computing device
168+ // / \param dim : array size
169+ // / \param vector1 : input array A
170+ // / \param constant1 : input constant a
171+ // / \param vector2 : input array B
172+ // / \param constant2 : input constant b
173+ // /
174+ // / Output Parameters
175+ // / \param result : output array
111176 void operator ()(const Device* d,
112177 const int & dim,
113178 std::complex <FPTYPE>* result,
@@ -120,6 +185,19 @@ template <typename FPTYPE, typename Device> struct constantvector_addORsub_const
120185// compute Y = alpha * X + Y
121186template <typename FPTYPE, typename Device> struct axpy_op
122187{
188+ // / @brief Y = alpha * X + Y
189+ // /
190+ // / Input Parameters
191+ // / \param d : the type of computing device
192+ // / \param N : array size
193+ // / \param alpha : input constant alpha
194+ // / \param X : input array X
195+ // / \param incX : computing strip of X
196+ // / \param Y : computing strip of Y
197+ // / \param incY : computing strip of Y
198+ // /
199+ // / Output Parameters
200+ // / \param Y : output array Y
123201 void operator ()(const Device* d,
124202 const int & N,
125203 const std::complex <FPTYPE>* alpha,
@@ -132,6 +210,24 @@ template <typename FPTYPE, typename Device> struct axpy_op
132210// compute y = alpha * op(A) * x + beta * y
133211template <typename FPTYPE, typename Device> struct gemv_op
134212{
213+ // / @brief y = alpha * op(A) * x + beta * y
214+ // /
215+ // / Input Parameters
216+ // / \param d : the type of computing device
217+ // / \param trans : whether to transpose A
218+ // / \param m : first dimension of matrix
219+ // / \param n : second dimension of matrix
220+ // / \param alpha : input constant alpha
221+ // / \param A : input matrix A
222+ // / \param lda : leading dimention of A
223+ // / \param X : input array X
224+ // / \param incx : computing strip of X
225+ // / \param beta : input constant beta
226+ // / \param Y : input array Y
227+ // / \param incy : computing strip of Y
228+ // /
229+ // / Output Parameters
230+ // / \param Y : output array Y
135231 void operator ()(const Device* d,
136232 const char & trans,
137233 const int & m,
@@ -150,6 +246,26 @@ template <typename FPTYPE, typename Device> struct gemv_op
150246// compute C = alpha * op(A) * op(B) + beta * C
151247template <typename FPTYPE, typename Device> struct gemm_op
152248{
249+ // / @brief C = alpha * op(A) * op(B) + beta * C
250+ // /
251+ // / Input Parameters
252+ // / \param d : the type of computing device
253+ // / \param transa : whether to transpose matrix A
254+ // / \param transb : whether to transpose matrix B
255+ // / \param m : first dimension of matrix mulplication
256+ // / \param n : second dimension of matrix mulplication
257+ // / \param k : third dimension of matrix mulplication
258+ // / \param alpha : input constant alpha
259+ // / \param a : input matrix A
260+ // / \param lda : leading dimention of A
261+ // / \param b : input matrix B
262+ // / \param ldb : leading dimention of A
263+ // / \param beta : input constant beta
264+ // / \param c : input matrix C
265+ // / \param ldc : leading dimention of C
266+ // /
267+ // / Output Parameters
268+ // / \param c : output matrix C
153269 void operator ()(const Device* d,
154270 const char & transa,
155271 const char & transb,
@@ -168,6 +284,16 @@ template <typename FPTYPE, typename Device> struct gemm_op
168284
169285template <typename FPTYPE, typename Device> struct matrixTranspose_op
170286{
287+ // / @brief transpose the input matrix
288+ // /
289+ // / Input Parameters
290+ // / \param d : the type of computing device
291+ // / \param row : first dimension of matrix
292+ // / \param col : second dimension of matrix
293+ // / \param input_matrix : input matrix
294+ // /
295+ // / Output Parameters
296+ // / \param output_matrix : output matrix
171297 void operator ()(const Device* d,
172298 const int & row,
173299 const int & col,
@@ -177,6 +303,17 @@ template <typename FPTYPE, typename Device> struct matrixTranspose_op
177303
178304template <typename FPTYPE, typename Device> struct matrixSetToAnother
179305{
306+ // / @brief initialize matrix B with A
307+ // /
308+ // / Input Parameters
309+ // / \param d : the type of computing device
310+ // / \param n : first dimension of matrix
311+ // / \param A : input matrix A
312+ // / \param LDA : leading dimension of A
313+ // / \param LDB : leading dimension of B
314+ // /
315+ // / Output Parameters
316+ // / \param B : output matrix B
180317 void operator ()(const Device* d,
181318 const int & n,
182319 const std::complex <FPTYPE>* A,
0 commit comments