-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
118 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using AtomsBuilder | ||
using DFTK | ||
using AMDGPU | ||
using PseudoPotentialData | ||
|
||
model = model_DFT(bulk(:Si); | ||
functionals=PBE(), | ||
pseudopotentials=PseudoFamily("cp2k.nc.sr.pbe.v0_1.semicore.gth")) | ||
|
||
# If available, use AMDGPU to store DFT quantities and perform main computations | ||
architecture = has_rocm_gpu() ? DFTK.GPU(AMDGPU.ROCArray) : DFTK.CPU() | ||
|
||
basis = PlaneWaveBasis(model; Ecut=20, kgrid=(1, 1, 1), architecture) | ||
|
||
# Anderson does not yet work ... | ||
scfres = self_consistent_field(basis; tol=1e-2, solver=scf_damping_solver()) |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module DFTKAMDGPUExt | ||
using AMDGPU | ||
using LinearAlgebra | ||
import DFTK: GPU | ||
using DFTK | ||
|
||
DFTK.synchronize_device(::GPU{<:AMDGPU.ROCArray}) = AMDGPU.synchronize() | ||
|
||
# Temporary workaround to not trigger https://github.com/JuliaGPU/AMDGPU.jl/issues/734 | ||
function LinearAlgebra.cholesky(A::Hermitian{T, <:AMDGPU.ROCArray}) where {T} | ||
Acopy, info = AMDGPU.rocSOLVER.potrf!(A.uplo, copy(A.data)) | ||
LinearAlgebra.Cholesky(Acopy, A.uplo, info) | ||
end | ||
|
||
end |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
# A dummy wrapper around an out-of-place FFT plan to make it appear in-place | ||
# This is needed for some generic FFT implementations, which do not have in-place plans | ||
# This is needed for some FFT implementations, which do not have in-place plans | ||
struct DummyInplace{opFFT} | ||
fft::opFFT | ||
end | ||
LinearAlgebra.mul!(Y, p::DummyInplace, X) = copy!(Y, p * X) | ||
LinearAlgebra.ldiv!(Y, p::DummyInplace, X) = copy!(Y, p \ X) | ||
|
||
import Base: *, \, length | ||
*(p::DummyInplace, X) = p.fft * X | ||
\(p::DummyInplace, X) = p.fft \ X | ||
import Base: *, length | ||
Base.:*(p::DummyInplace, X) = copy!(X, p.fft * X) | ||
length(p::DummyInplace) = length(p.fft) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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