Refactor: refactor `psi::memory` namespace and add `module_device` in `module_base`
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/.
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.
@haozhihan Does the codes under source/module_psi/kernels is still required? If not so, please remove those files instead of commenting them out.