Skip to content

Commit 5a6f494

Browse files
Remove DiagH class in hsolver (#5307)
* Remove diagh Pointer in lcao solver tests * Remove const_nums in diagh.h * Remove diago_david dependency on diagh.h * Remove diago_dav_subspace dependency on diagh.h * Remove diago_cg dependency on diagh.h * Remove diago_bpcg dependency on diagh.h * Remove diago_lapack&scalapack dependency on diagh.h * Remove diago_lapack dependency on diagh.h * Add hamilt.h to diago_lapack * Remove diago_elpa dependency on diagh.h * Remove diago_cusolver dependency on diagh.h * Remove diago_pexsi dependency on diagh.h * Remove diago_cusolvermp&elpa_native dependency on diagh.h * Remove hsolver_lcaopw dependency on diagh.h * Remove hsolver dependency on diagh.h --------- Co-authored-by: Haozhi Han <[email protected]>
1 parent 7194eb7 commit 5a6f494

18 files changed

+32
-28
lines changed

source/module_hsolver/diagh.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212
#include "mpi.h"
1313
#endif
1414

15-
// template <typename T>
16-
// struct const_nums
17-
// {
18-
// const_nums();
19-
// T zero;
20-
// T one;
21-
// T neg_one;
22-
// };
23-
2415
namespace hsolver
2516
{
2617

source/module_hsolver/diago_bpcg.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#ifndef DIAGO_BPCG_H_
22
#define DIAGO_BPCG_H_
33

4-
#include "diagh.h"
5-
#include "module_base/complexmatrix.h"
4+
#include "module_hamilt_general/hamilt.h"
65
#include "module_hamilt_pw/hamilt_pwdft/structure_factor.h"
76

87
#include "module_base/module_device/types.h"

source/module_hsolver/diago_cg.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include <module_base/memory.h>
99
#include <module_base/parallel_reduce.h>
1010
#include <module_base/timer.h>
11+
#include <module_base/tool_title.h> // ModuleBase::TITLE
12+
#include <module_base/global_function.h> // ModuleBase::GlobalFunc::NOTE
1113
#include <module_hsolver/diago_cg.h>
1214

1315
using namespace hsolver;

source/module_hsolver/diago_cg.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <functional>
55

66
#include <module_base/macros.h>
7-
#include <module_hsolver/diagh.h>
87
#include <module_hsolver/kernels/math_kernel_op.h>
98

109
#include <ATen/core/tensor.h>

source/module_hsolver/diago_cusolver.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#ifndef DIAGOCUSOLVER_H
22
#define DIAGOCUSOLVER_H
33

4-
#include "diagh.h"
4+
#include "module_base/macros.h" // GetRealType
5+
#include "module_hamilt_general/hamilt.h"
56
#include "module_basis/module_ao/parallel_orbitals.h"
67
#include "module_hsolver/kernels/cuda/diag_cusolver.cuh"
78
// #include "module_hsolver/kernels/cuda/dngvd_op.cu"

source/module_hsolver/diago_cusolvermp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define DIAGO_CUSOLVERMPH
33

44
#ifdef __CUSOLVERMP
5-
#include "diagh.h"
5+
#include "module_hamilt_general/hamilt.h"
66
#include "module_base/macros.h"
77
#include "module_basis/module_ao/parallel_orbitals.h"
88
#include "module_hsolver/kernels/cuda/diag_cusolvermp.cuh"

source/module_hsolver/diago_dav_subspace.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#ifndef DIAGO_NEW_DAV_H
22
#define DIAGO_NEW_DAV_H
33

4-
#include "diagh.h"
4+
#include "module_base/macros.h" // GetRealType
5+
#include "module_base/module_device/device.h" // base_device
6+
#include "module_base/module_device/memory_op.h"// base_device::memory"
7+
58
#include "module_hsolver/diag_comm_info.h"
69
#include "module_hsolver/diag_const_nums.h"
710

11+
#include <vector>
812
#include <functional>
913

1014
namespace hsolver

source/module_hsolver/diago_david.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "diago_david.h"
22

3-
#include "module_base/timer.h"
3+
#include "module_base/timer.h" // ModuleBase::timer::tick
4+
#include "module_base/tool_title.h" // ModuleBase::TITLE
45
#include "module_base/module_device/device.h"
56

67
#include "module_hsolver/kernels/dngvd_op.h"

source/module_hsolver/diago_david.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
#ifndef DIAGODAVID_H
22
#define DIAGODAVID_H
33

4-
#include "diagh.h"
4+
#include "module_base/macros.h" // GetRealType
5+
#include "module_base/module_device/device.h" // base_device
6+
#include "module_base/module_device/memory_op.h"// base_device::memory
7+
58
#include "module_hsolver/diag_comm_info.h"
69

10+
#include <vector>
11+
#include <functional>
12+
713
namespace hsolver
814
{
915

@@ -199,7 +205,7 @@ class DiagoDavid
199205
using syncmem_h2d_op = base_device::memory::synchronize_memory_op<T, Device, base_device::DEVICE_CPU>;
200206
using syncmem_d2h_op = base_device::memory::synchronize_memory_op<T, base_device::DEVICE_CPU, Device>;
201207

202-
using hpsi_info = typename hamilt::Operator<T, Device>::hpsi_info;
208+
// using hpsi_info = typename hamilt::Operator<T, Device>::hpsi_info; // Dependence of hpsi removed
203209

204210
const T *one = nullptr, *zero = nullptr, *neg_one = nullptr;
205211
const T one_ = static_cast<T>(1.0), zero_ = static_cast<T>(0.0), neg_one_ = static_cast<T>(-1.0);

source/module_hsolver/diago_elpa.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#ifndef DIAGOELPA_H
22
#define DIAGOELPA_H
33

4-
#include "diagh.h"
4+
#include "module_base/macros.h" // GetRealType
5+
#include "module_hamilt_general/hamilt.h"
56
#include "module_basis/module_ao/parallel_orbitals.h"
67

78
namespace hsolver

0 commit comments

Comments
 (0)