Skip to content

Commit 7b94610

Browse files
committed
Initialize DSP hardware
1 parent f29c573 commit 7b94610

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

source/module_base/kernels/dsp/dsp_connector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifdef __DSP
22

33
// Base dsp functions
4-
void createMtblasHandle(int id);
5-
void destroyMtblasHandle();
4+
void dspInitHandle(int id);
5+
void dspDestoryHandle();
66
void *malloc_ht(size_t bytes);
77
void free_ht(void* ptr);
88

source/module_esolver/esolver_ks_pw.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ ESolver_KS_PW<T, Device>::ESolver_KS_PW()
6767
container::kernels::createGpuSolverHandle();
6868
}
6969
#endif
70+
#ifdef __DSP
71+
std::cout << " ** Initializing DSP Hardware..." << std::endl;
72+
dspInitHandle(GlobalV::MY_RANK % 4);
73+
#endif
7074
}
7175

7276
template <typename T, typename Device>
@@ -92,7 +96,10 @@ ESolver_KS_PW<T, Device>::~ESolver_KS_PW()
9296
#endif
9397
delete reinterpret_cast<psi::Psi<T, Device>*>(this->kspw_psi);
9498
}
95-
99+
#ifdef __DSP
100+
std::cout << " ** Closing DSP Hardware..." << std::endl;
101+
dspDestoryHandle();
102+
#endif
96103
if (PARAM.inp.precision == "single")
97104
{
98105
delete reinterpret_cast<psi::Psi<std::complex<double>, Device>*>(this->__kspw_psi);

0 commit comments

Comments
 (0)