-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port XC term instantiation and forces to GPU #1061
Conversation
src/terms/xc.jl
Outdated
.* (-2T(π)) .* G .* im | ||
./ sqrt(basis.model.unit_cell_volume)) | ||
Gs = G_vectors(basis) | ||
work = to_device(basis.architecture, zeros(Complex{TT}, length(Gs))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you allocate the zeros directly on the device (see zeros_like
function in DFTK)
src/terms/xc.jl
Outdated
nlcc_groups = [(igroup, group) for (igroup, group) in enumerate(basis.model.atom_groups) | ||
if has_core_density(model.atoms[first(group)])] | ||
if has_core_density(basis.model.atoms[first(group)])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use filter
here ... and then only add the igroup
in the for
loop in _forces_xc
below. I find it a little strange that the index is added, but this is not really used for anything in this function, but only in the called function. That's a little surprising.
Implemented suggested changes and type instabilities in |
Applied similar strategy as PR #1056 in order to port the XC term to the GPU.
The
_force_xc
function makes this a little bit awkward for the forces.