Skip to content

Commit

Permalink
Use iscu to just adapt CUDA computations. skip on CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
kmp5VT committed Oct 9, 2023
1 parent 0788770 commit 78ecb1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mps/dmrg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ function dmrg(PH, psi0::MPS, sweeps::Sweeps; kwargs...)
energy = vals[1]
## Right now there is a conversion problem in CUDA.jl where `UnifiedMemory` Arrays are being converted
## into `DeviceMemory`. This conversion line is here temporarily to fix that problem when it arises
phi::ITensor = itensor(convert(typeof(tensor(phi)), tensor(vecs[1])))
## Adapt is only called when using CUDA backend. CPU will work as implemented previously.
phi::ITensor = NDTensors.iscu(tensor(phi)) ? itensor(adapt(typeof(data(phi)), tensor(vecs[1]))) : vecs[1]
#phi::ITensor = vecs[1]

ortho = ha == 1 ? "left" : "right"
Expand Down

0 comments on commit 78ecb1b

Please sign in to comment.