Skip to content

Refactor: Remove obsolete cross-device copy constructor in HamiltPW#7418

Merged
mohanchen merged 2 commits into
deepmodeling:developfrom
AsTonyshment:clean_hamilt_pw
Jun 1, 2026
Merged

Refactor: Remove obsolete cross-device copy constructor in HamiltPW#7418
mohanchen merged 2 commits into
deepmodeling:developfrom
AsTonyshment:clean_hamilt_pw

Conversation

@AsTonyshment
Copy link
Copy Markdown
Collaborator

Description

This PR removes the unused cross-device copy constructor HamiltPW(const HamiltPW<T_in, Device_in> *hamilt) and cleans up the associated dead code.

Background:
This constructor was originally introduced in PR #1502 to facilitate the deep copying and conversion of Hamiltonian objects between CPU and GPU devices. However, following the comprehensive generic <FPTYPE, Device> refactoring and the introduction of tensor-based memory synchronization in PR #1535, the eigensolvers no longer require direct cross-device casting of the HamiltPW object. All calls to this constructor have already been removed.

Changes:

  • Removed the HamiltPW::HamiltPW(const HamiltPW<T_in, Device_in> *hamilt) implementation in hamilt_pw.cpp.
  • Removed the corresponding template constructor declaration in hamilt_pw.h.

Copilot AI review requested due to automatic review settings June 1, 2026 05:02
@AsTonyshment AsTonyshment requested review from mohanchen and removed request for Copilot June 1, 2026 05:05
@mohanchen mohanchen added Refactor Refactor ABACUS codes GPU & DCU & HPC GPU and DCU and HPC related any issues labels Jun 1, 2026
@mohanchen mohanchen merged commit 46fe015 into deepmodeling:develop Jun 1, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GPU & DCU & HPC GPU and DCU and HPC related any issues Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants