abacus-develop icon indicating copy to clipboard operation
abacus-develop copied to clipboard

Refactor: refactor `psi::memory` namespace and add `module_device` in `module_base`

Open haozhihan opened this issue 1 year ago • 1 comments

Reminder

  • [x] Have you linked an issue with this pull request?
  • [x] Have you added adequate unit tests and/or case tests for your pull request?

Linked Issue

Close #4095

Details

  • We have noticed that the current code for heterogeneous computing heavily relies on the device and memory related functions under the module_psi/kernel/ folder.
  • But these functions have gradually begun to serve the heterogeneous computing code of various parts in the entire Abacus software.

Therefore, the naming of the namespaces in module_psi/kernel/ code is no longer reasonable, the dependency relationships between modules are no longer reasonable, and the storage location is even more unreasonable.

Based on the above situation, I have refactored the code related heterogeneous computing in module_psi/kernel/.

haozhihan avatar May 09 '24 18:05 haozhihan

device

mohanchen avatar May 11 '24 07:05 mohanchen

LGTM! However, I find the namespace base_device a bit confusing since it's not a common convention. I've never seen a namespace used like this before. Would it be possible to use ModuleBase::device instead? I believe it would be more straightforward and easier to understand where the related codes come from.

denghuilu avatar May 12 '24 02:05 denghuilu

@haozhihan Does the codes under source/module_psi/kernels is still required? If not so, please remove those files instead of commenting them out.

caic99 avatar Jun 12 '24 14:06 caic99