fix(gpu): guard qq synchronization without projectors - #7816
Open
GenZeal-Lin wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fixes #7681
What's changed?
For pseudopotentials without nonlocal projectors,
nhmis zero andthe corresponding qq buffers are not allocated.
The previous GPU initialization path still attempted to synchronize
these qq buffers, which could pass an invalid destination pointer to
CUDA memory-copy operations and trigger
cudaMemcpy invalid argument.This change guards the synchronization of
s_qq_nt,c_qq_so,z_qq_so, andd_qq_ntwithnhm > 0.The existing path for pseudopotentials with nonlocal projectors
(
nhm > 0) is unchanged.Verification
001_PW_UPF100_Al(nhm > 0) and016_PW_BLPS–019_PW_Coulomb(nhm == 0) passed the coredefault-precision regression tests.
nhm == 0andnhm > 0completed successfully.
which is related to MPI/reference configuration rather than this fix.
Scope
source/source_pw/module_pwdft/vnl_pw.cpp