Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
kmp5VT committed Oct 9, 2023
1 parent 78ecb1b commit 2d46f5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion NDTensors/src/abstractarray/similar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ end

# For when there are CUArray specific issues inline
iscu(A::AbstractArray) = iscu(typeof(A))
iscu(A::Type{<:AbstractArray}) = (leaf_parenttype(A) == A ? false : iscu(leaf_parenttype(A)))
function iscu(A::Type{<:AbstractArray})
return (leaf_parenttype(A) == A ? false : iscu(leaf_parenttype(A)))
end
# This function actually allocates the data.
# Catches conversions of dimensions specified by ranges
# dimensions specified by integers with `Base.to_shape`.
Expand Down
6 changes: 5 additions & 1 deletion src/mps/dmrg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ function dmrg(PH, psi0::MPS, sweeps::Sweeps; kwargs...)
## 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
## 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 = if NDTensors.iscu(tensor(phi))
itensor(adapt(typeof(data(phi)), tensor(vecs[1])))
else
vecs[1]
end
#phi::ITensor = vecs[1]

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

0 comments on commit 2d46f5a

Please sign in to comment.