Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Linked Issue
Fix #6429
What's changed?
recip2real
andreal2recip
functions. To resolve this, we have modified these functions to use the DSP device instead of the CPU device.Refactor
Attention
The recip_to_real template function is designed to be compatible with floating-point types and device types, enabling a heterogeneous framework. Moving forward, if device-specific or parameter-type requirements arise, we can directly utilize this templated function for seamless execution.
For pw_basis and pw_basis_k, template parameters are used to determine whether functions operate in real or reciprocal space. This approach clearly indicates whether calculations are performed in real or reciprocal space, improving code readability.
The main drawback is increased complexity in invocation, which demands higher programming expertise. When writing templated code, if the FFT function’s template parameter is T but operates on complex at runtime, programmers must fully understand the context. Type mismatches will be caught at compile time, preventing runtime errors.
This seems to mean that the DSP does not support grids that are powers of two (2^n grid points). We should express this in standard technical terms.
The DSP FFT could only use the kpar parallel way, but we can't use mpi solve the gamma only