Skip to content

Commit

Permalink
Fixing gpu CI (#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
epolack authored Dec 25, 2023
1 parent ecdfa73 commit 25c64ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/terms/hartree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function compute_poisson_green_coeffs(basis::PlaneWaveBasis{T}, scaling_factor;
# Solving the Poisson equation ΔV = -4π ρ in Fourier space
# is multiplying elementwise by 4π / |G|^2.
poisson_green_coeffs = 4T(π) ./ [sum(abs2, model.recip_lattice * (G + q))
for G in G_vectors(basis)]
for G in to_cpu(G_vectors(basis))]
if iszero(q)
# Compensating charge background => Zero DC.
GPUArraysCore.@allowscalar poisson_green_coeffs[1] = 0
Expand Down
4 changes: 2 additions & 2 deletions src/terms/local.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function compute_local_potential(S, basis::PlaneWaveBasis{T}; positions=basis.mo
# positions, this involves a form factor (`local_potential_fourier`)
# and a structure factor e^{-i G·r}
model = basis.model
Gqs_cart = [model.recip_lattice * (G + q) for G in G_vectors(basis)]
Gqs_cart = [model.recip_lattice * (G + q) for G in to_cpu(G_vectors(basis))]
# TODO Bring Gqs_cart on the CPU for compatibility with the pseudopotentials which
# are not isbits ... might be able to solve this by restructuring the loop

Expand All @@ -107,7 +107,7 @@ function compute_local_potential(S, basis::PlaneWaveBasis{T}; positions=basis.mo
end
end

Gqs = [G + q for G in G_vectors(basis)] # TODO Again for GPU compatibility
Gqs = [G + q for G in to_cpu(G_vectors(basis))] # TODO Again for GPU compatibility
pot_fourier = map(enumerate(Gqs)) do (iG, G)
p = norm(Gqs_cart[iG])
pot = sum(enumerate(model.atom_groups)) do (igroup, group)
Expand Down

0 comments on commit 25c64ce

Please sign in to comment.