From 25c64ce4c2e2a71a27f1dfc55d2b8fee0cc4fd27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Polack?= <87805034+epolack@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:39:09 +0000 Subject: [PATCH] Fixing gpu CI (#933) --- src/terms/hartree.jl | 2 +- src/terms/local.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/terms/hartree.jl b/src/terms/hartree.jl index d039f3ba58..729a1f2373 100644 --- a/src/terms/hartree.jl +++ b/src/terms/hartree.jl @@ -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 diff --git a/src/terms/local.jl b/src/terms/local.jl index b4a95c4520..4d6324a9c5 100644 --- a/src/terms/local.jl +++ b/src/terms/local.jl @@ -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 @@ -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)