Skip to content

Commit 4cfa47d

Browse files
committed
remove unused code and redundancies
1 parent f3c3d75 commit 4cfa47d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

source/module_hsolver/diago_bpcg.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ void DiagoBPCG<T, Device>::orth_projection(
169169
/*conj_x=*/false, /*conj_y=*/true, /*alpha=*/1.0, /*beta=*/0.0, /*Tensor out=*/&hsub_in);
170170
// hsub_in = ct::op::einsum("ij,kj->ik", grad_out, psi_in, option);
171171

172-
// this->orth_projection(this->psi, this->hsub, this->grad);
173172
// gemm: hsub_in(n_band x n_band) = psi_in^T(n_band x n_basis) * grad_out(n_basis x n_band)
174173
gemm_op()(this->ctx,
175174
'C',
@@ -209,8 +208,7 @@ void DiagoBPCG<T, Device>::orth_projection(
209208
grad_out.data<T>(),
210209
this->n_basis); //ldc
211210

212-
// * This type of non inner produce like operation does not need reduce!
213-
// Parallel_Reduce::reduce_pool(grad_out.data<T>(), this->n_basis * this->n_band);
211+
// * This type of non inner product like operation does not need reduce!
214212

215213
return;
216214
}
@@ -225,8 +223,6 @@ void DiagoBPCG<T, Device>::rotate_wf(
225223
/*conj_x=*/false, /*conj_y=*/false, /*alpha=*/1.0, /*beta=*/0.0, /*Tensor out=*/&workspace_in);
226224
// workspace_in = ct::op::einsum("ij,jk->ik", hsub_in, psi_out, option);
227225

228-
// this->rotate_wf(hsub_out, psi_out, workspace_in);
229-
// this->orth_cholesky(this->work, this->psi, this->hpsi, this->hsub);
230226
// gemm: workspace_in(n_basis x n_band) = psi_out(n_basis x n_band) * hsub_in(n_band x n_band)
231227
gemm_op()(this->ctx,
232228
'N',
@@ -243,8 +239,7 @@ void DiagoBPCG<T, Device>::rotate_wf(
243239
workspace_in.data<T>(),
244240
this->n_basis); //ldc
245241

246-
// * This type of non inner produce like operation does not need reduce!
247-
// Parallel_Reduce::reduce_pool(workspace_in.data<T>(), this->n_basis * this->n_band);
242+
// * This type of non inner product like operation does not need reduce!
248243

249244
syncmem_complex_op()(psi_out.template data<T>(), workspace_in.template data<T>(), this->n_band * this->n_basis);
250245

source/module_hsolver/diago_bpcg.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@ class DiagoBPCG
340340
using resmem_complex_op = ct::kernels::resize_memory<T, ct_Device>;
341341
using syncmem_complex_op = ct::kernels::synchronize_memory<T, ct_Device, ct_Device>;
342342

343+
// note: these operators use template parameter base_device::Device_*
344+
// defined in module_base/module_device/types.h
345+
// different from ct_Device!
343346
using calc_grad_with_block_op = hsolver::calc_grad_with_block_op<T, Device>;
344347
using line_minimize_with_block_op = hsolver::line_minimize_with_block_op<T, Device>;
345348
using gemm_op = hsolver::gemm_op<T, Device>;

0 commit comments

Comments
 (0)