@@ -46,7 +46,7 @@ class Stochastic_Iter
4646
4747 /* *
4848 * @brief sum demet and eband energies for each k point and each band
49- *
49+ *
5050 * @param stowf stochastic wave function
5151 * @param pes elecstate
5252 * @param pHamilt hamiltonian
@@ -59,7 +59,7 @@ class Stochastic_Iter
5959
6060 /* *
6161 * @brief calculate the density
62- *
62+ *
6363 * @param ucell reference to unit cell
6464 * @param stowf stochastic wave function
6565 * @param pes elecstate
@@ -72,23 +72,23 @@ class Stochastic_Iter
7272
7373 /* *
7474 * @brief calculate total number of electrons
75- *
75+ *
7676 * @param pes elecstate
77- * @return double
77+ * @return double
7878 */
7979 double calne (elecstate::ElecState* pes);
8080
8181 /* *
8282 * @brief solve ne(mu) = ne_target and get chemical potential mu
83- *
83+ *
8484 * @param iter scf iteration index
8585 * @param pes elecstate
8686 */
8787 void itermu (const int iter, elecstate::ElecState* pes);
8888
8989 /* *
9090 * @brief orthogonalize stochastic wave functions with KS wave functions
91- *
91+ *
9292 * @param ik k point index
9393 * @param psi KS wave functions
9494 * @param stowf stochastic wave functions
@@ -97,7 +97,7 @@ class Stochastic_Iter
9797
9898 /* *
9999 * @brief check emax and emin
100- *
100+ *
101101 * @param ik k point index
102102 * @param istep ion step index
103103 * @param iter scf iteration index
@@ -107,7 +107,7 @@ class Stochastic_Iter
107107
108108 /* *
109109 * @brief check precision of Chebyshev expansion
110- *
110+ *
111111 * @param ref reference value
112112 * @param thr threshold
113113 * @param info information
@@ -153,14 +153,22 @@ class Stochastic_Iter
153153 const Device* ctx = {};
154154 const base_device::DEVICE_CPU* cpu_ctx = {};
155155 using ct_Device = typename container::PsiToContainer<Device>::type;
156+ #ifdef __DSP
157+ using setmem_var_op = base_device::memory::set_memory_op_mt<Real, Device>;
158+ using resmem_var_op = base_device::memory::resize_memory_op_mt<Real, Device>;
159+ using delmem_var_op = base_device::memory::delete_memory_op_mt<Real, Device>;
160+ using resmem_complex_op = base_device::memory::resize_memory_op_mt<T, Device>;
161+ using delmem_complex_op = base_device::memory::delete_memory_op_mt<T, Device>;
162+ #else
156163 using setmem_var_op = base_device::memory::set_memory_op<Real, Device>;
157- using syncmem_var_h2d_op = base_device::memory::synchronize_memory_op<Real, Device, base_device::DEVICE_CPU>;
158- using syncmem_var_d2h_op = base_device::memory::synchronize_memory_op<Real, base_device::DEVICE_CPU, Device>;
159- using cpymem_complex_op = base_device::memory::synchronize_memory_op<T, Device, Device>;
160164 using resmem_var_op = base_device::memory::resize_memory_op<Real, Device>;
161165 using delmem_var_op = base_device::memory::delete_memory_op<Real, Device>;
162166 using resmem_complex_op = base_device::memory::resize_memory_op<T, Device>;
163167 using delmem_complex_op = base_device::memory::delete_memory_op<T, Device>;
168+ #endif
169+ using syncmem_var_h2d_op = base_device::memory::synchronize_memory_op<Real, Device, base_device::DEVICE_CPU>;
170+ using syncmem_var_d2h_op = base_device::memory::synchronize_memory_op<Real, base_device::DEVICE_CPU, Device>;
171+ using cpymem_complex_op = base_device::memory::synchronize_memory_op<T, Device, Device>;
164172 using castmem_d2z_op = base_device::memory::cast_memory_op<T, Real, Device, Device>;
165173 using castmem_var_d2h_op = base_device::memory::cast_memory_op<double , Real, base_device::DEVICE_CPU, Device>;
166174 using gemv_op = ModuleBase::gemv_op<T, Device>;
0 commit comments