Skip to content

Commit f47631c

Browse files
committed
Rename dngvd to hegvd
1 parent 96a77de commit f47631c

File tree

4 files changed

+28
-20
lines changed

4 files changed

+28
-20
lines changed

source/source_hsolver/kernels/cuda/dngvd_op.cu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void xheevd_wrapper (
205205
}
206206

207207
template <typename T>
208-
struct dngvd_op<T, base_device::DEVICE_GPU>
208+
struct hegvd_op<T, base_device::DEVICE_GPU>
209209
{
210210
using Real = typename GetTypeReal<T>::type;
211211
void operator()(const base_device::DEVICE_GPU* d,
@@ -260,16 +260,16 @@ struct dngvx_op<T, base_device::DEVICE_GPU>
260260
}
261261
};
262262

263-
template struct dngvd_op<std::complex<float>, base_device::DEVICE_GPU>;
263+
template struct hegvd_op<std::complex<float>, base_device::DEVICE_GPU>;
264264
template struct heevx_op<std::complex<float>, base_device::DEVICE_GPU>;
265265
template struct dngvx_op<std::complex<float>, base_device::DEVICE_GPU>;
266266

267-
template struct dngvd_op<std::complex<double>, base_device::DEVICE_GPU>;
267+
template struct hegvd_op<std::complex<double>, base_device::DEVICE_GPU>;
268268
template struct heevx_op<std::complex<double>, base_device::DEVICE_GPU>;
269269
template struct dngvx_op<std::complex<double>, base_device::DEVICE_GPU>;
270270

271271
#ifdef __LCAO
272-
template struct dngvd_op<double, base_device::DEVICE_GPU>;
272+
template struct hegvd_op<double, base_device::DEVICE_GPU>;
273273
template struct heevx_op<double, base_device::DEVICE_GPU>;
274274
template struct dngvx_op<double, base_device::DEVICE_GPU>;
275275
#endif

source/source_hsolver/kernels/dngvd_op.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace hsolver
88
{
99
// hegvd and sygvd; dn for dense?
1010
template <typename T>
11-
struct dngvd_op<T, base_device::DEVICE_CPU>
11+
struct hegvd_op<T, base_device::DEVICE_CPU>
1212
{
1313
using Real = typename GetTypeReal<T>::type;
1414
void operator()(const base_device::DEVICE_CPU* d,
@@ -139,6 +139,14 @@ struct dngv_op<T, base_device::DEVICE_CPU>
139139
}
140140
};
141141

142+
// heevx and syevx
143+
/**
144+
* @brief heevx computes the first m eigenvalues and their corresponding eigenvectors of
145+
* a complex generalized Hermitian-definite eigenproblem.
146+
*
147+
* both heevx and syevx are implemented through the `evx` interface of LAPACK.
148+
* wrapped in LapackWrapper::xheevx
149+
*/
142150
template <typename T>
143151
struct heevx_op<T, base_device::DEVICE_CPU>
144152
{
@@ -321,8 +329,8 @@ struct dngvx_op<T, base_device::DEVICE_CPU>
321329
}
322330
};
323331

324-
template struct dngvd_op<std::complex<float>, base_device::DEVICE_CPU>;
325-
template struct dngvd_op<std::complex<double>, base_device::DEVICE_CPU>;
332+
template struct hegvd_op<std::complex<float>, base_device::DEVICE_CPU>;
333+
template struct hegvd_op<std::complex<double>, base_device::DEVICE_CPU>;
326334

327335
template struct heevx_op<std::complex<float>, base_device::DEVICE_CPU>;
328336
template struct heevx_op<std::complex<double>, base_device::DEVICE_CPU>;
@@ -333,7 +341,7 @@ template struct dngvx_op<std::complex<double>, base_device::DEVICE_CPU>;
333341
template struct dngv_op<std::complex<float>, base_device::DEVICE_CPU>;
334342
template struct dngv_op<std::complex<double>, base_device::DEVICE_CPU>;
335343
#ifdef __LCAO
336-
template struct dngvd_op<double, base_device::DEVICE_CPU>;
344+
template struct hegvd_op<double, base_device::DEVICE_CPU>;
337345
template struct heevx_op<double, base_device::DEVICE_CPU>;
338346
template struct dngvx_op<double, base_device::DEVICE_CPU>;
339347
template struct dngv_op<double, base_device::DEVICE_CPU>;

source/source_hsolver/kernels/dngvd_op.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ inline float get_real(const float &x) { return x; }
2121

2222

2323
template <typename T, typename Device>
24-
struct dngvd_op
24+
struct hegvd_op
2525
{
2626
using Real = typename GetTypeReal<T>::type;
27-
/// @brief DNGVD computes all the eigenvalues and eigenvectors of a complex generalized
27+
/// @brief HEGVD computes all the eigenvalues and eigenvectors of a complex generalized
2828
/// Hermitian-definite eigenproblem. If eigenvectors are desired, it uses a divide and conquer algorithm.
2929
///
3030
/// In this op, the CPU version is implemented through the `gvd` interface, and the CUDA version

source/source_hsolver/kernels/rocm/dngvd_op.hip.cu

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace hsolver {
77

8-
// NOTE: mimicked from ../cuda/dngvd_op.cu for three dngvd_op
8+
// NOTE: mimicked from ../cuda/dngvd_op.cu for three hegvd_op
99

1010
static hipsolverHandle_t hipsolver_H = nullptr;
1111
// Test on DCU platform. When nstart is greater than 234, code on DCU performs better.
@@ -28,15 +28,15 @@ void destroyGpuSolverHandle() {
2828

2929
#ifdef __LCAO
3030
template <>
31-
void dngvd_op<double, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* ctx,
31+
void hegvd_op<double, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* ctx,
3232
const int nstart,
3333
const int ldh,
3434
const double* _hcc,
3535
const double* _scc,
3636
double* _eigenvalue,
3737
double* _vcc)
3838
{
39-
// copied from ../cuda/dngvd_op.cu, "dngvd_op"
39+
// copied from ../cuda/dngvd_op.cu, "hegvd_op"
4040
assert(nstart == ldh);
4141

4242
if (nstart > N_DCU){
@@ -86,7 +86,7 @@ void dngvd_op<double, base_device::DEVICE_GPU>::operator()(const base_device::DE
8686
hipErrcheck(hipMemcpy(hcc.data(), _hcc, sizeof(double) * hcc.size(), hipMemcpyDeviceToHost));
8787
hipErrcheck(hipMemcpy(scc.data(), _scc, sizeof(double) * scc.size(), hipMemcpyDeviceToHost));
8888
base_device::DEVICE_CPU* cpu_ctx = {};
89-
dngvd_op<double, base_device::DEVICE_CPU>()(cpu_ctx,
89+
hegvd_op<double, base_device::DEVICE_CPU>()(cpu_ctx,
9090
nstart,
9191
ldh,
9292
hcc.data(),
@@ -102,15 +102,15 @@ void dngvd_op<double, base_device::DEVICE_GPU>::operator()(const base_device::DE
102102
#endif // __LCAO
103103

104104
template <>
105-
void dngvd_op<std::complex<float>, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* ctx,
105+
void hegvd_op<std::complex<float>, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* ctx,
106106
const int nstart,
107107
const int ldh,
108108
const std::complex<float>* _hcc,
109109
const std::complex<float>* _scc,
110110
float* _eigenvalue,
111111
std::complex<float>* _vcc)
112112
{
113-
// copied from ../cuda/dngvd_op.cu, "dngvd_op"
113+
// copied from ../cuda/dngvd_op.cu, "hegvd_op"
114114
assert(nstart == ldh);
115115

116116
if (nstart > N_DCU){
@@ -159,7 +159,7 @@ void dngvd_op<std::complex<float>, base_device::DEVICE_GPU>::operator()(const ba
159159
hipErrcheck(hipMemcpy(hcc.data(), _hcc, sizeof(std::complex<float>) * hcc.size(), hipMemcpyDeviceToHost));
160160
hipErrcheck(hipMemcpy(scc.data(), _scc, sizeof(std::complex<float>) * scc.size(), hipMemcpyDeviceToHost));
161161
base_device::DEVICE_CPU* cpu_ctx = {};
162-
dngvd_op<std::complex<float>, base_device::DEVICE_CPU>()(cpu_ctx,
162+
hegvd_op<std::complex<float>, base_device::DEVICE_CPU>()(cpu_ctx,
163163
nstart,
164164
ldh,
165165
hcc.data(),
@@ -174,7 +174,7 @@ void dngvd_op<std::complex<float>, base_device::DEVICE_GPU>::operator()(const ba
174174
}
175175

176176
template <>
177-
void dngvd_op<std::complex<double>, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* ctx,
177+
void hegvd_op<std::complex<double>, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* ctx,
178178
const int nstart,
179179
const int ldh,
180180
const std::complex<double>* _hcc,
@@ -183,7 +183,7 @@ void dngvd_op<std::complex<double>, base_device::DEVICE_GPU>::operator()(const b
183183
std::complex<double>* _vcc
184184
)
185185
{
186-
// copied from ../cuda/dngvd_op.cu, "dngvd_op"
186+
// copied from ../cuda/dngvd_op.cu, "hegvd_op"
187187
// assert(nstart == ldh);
188188

189189
// save a copy of scc in case the diagonalization fails
@@ -237,7 +237,7 @@ void dngvd_op<std::complex<double>, base_device::DEVICE_GPU>::operator()(const b
237237
hipErrcheck(hipMemcpy(hcc.data(), _hcc, sizeof(std::complex<double>) * hcc.size(), hipMemcpyDeviceToHost));
238238
hipErrcheck(hipMemcpy(scc.data(), _scc, sizeof(std::complex<double>) * scc.size(), hipMemcpyDeviceToHost));
239239
base_device::DEVICE_CPU* cpu_ctx = {};
240-
dngvd_op<std::complex<double>, base_device::DEVICE_CPU>()(cpu_ctx,
240+
hegvd_op<std::complex<double>, base_device::DEVICE_CPU>()(cpu_ctx,
241241
nstart,
242242
ldh,
243243
hcc.data(),

0 commit comments

Comments
 (0)