Skip to content

Commit 2c66082

Browse files
committed
Set algo
1 parent 011f496 commit 2c66082

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

test/cuda/operators.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ using Test, TestExtras
33
using MPSKit
44
using MPSKit: GeometryStyle, FiniteChainStyle, InfiniteChainStyle, OperatorStyle, MPOStyle
55
using TensorKit
6+
using MatrixAlgebraKit
67
using TensorKit: ℙ, tensormaptype, TensorMapWithStorage
78
using Adapt, CUDA, cuTENSOR
89

10+
MPSKit.Defaults.alg_svd() = CUSOLVER_QRIteration()
11+
912
@testset "CuFiniteMPO" for V in (ℂ^2, U1Space(0 => 1, 1 => 1))
1013
# start from random operators
1114
L = 4
@@ -15,15 +18,18 @@ using Adapt, CUDA, cuTENSOR
1518
O₂ = rand(T, space(O₁))
1619
O₃ = rand(real(T), space(O₁))
1720

18-
mpo₁ = adapt(CuArray, FiniteMPO(O₁))
19-
mpo₂ = adapt(CuArray, FiniteMPO(O₂))
20-
mpo₃ = adapt(CuArray, FiniteMPO(O₃))
21+
mpo₁ = adapt(CuVector{T, CUDA.DeviceMemory}, FiniteMPO(O₁))
22+
mpo₂ = adapt(CuVector{T, CUDA.DeviceMemory}, FiniteMPO(O₂))
23+
mpo₃ = adapt(CuVector{T, CUDA.DeviceMemory}, FiniteMPO(O₃))
2124

2225
@test isfinite(mpo₁)
2326
@test isfinite(typeof(mpo₁))
2427
@test GeometryStyle(typeof(mpo₁)) == FiniteChainStyle()
2528
@test GeometryStyle(mpo₁) == FiniteChainStyle()
2629
@test OperatorStyle(typeof(mpo₁)) == MPOStyle()
30+
@test TensorKit.storagetype(mpo₁) == CuVector{T, CUDA.DeviceMemory}
31+
@test TensorKit.storagetype(mpo₂) == CuVector{T, CUDA.DeviceMemory}
32+
@test TensorKit.storagetype(mpo₃) == CuVector{T, CUDA.DeviceMemory}
2733

2834
@test @constinferred physicalspace(mpo₁) == fill(V, L)
2935
Vleft = @constinferred left_virtualspace(mpo₁)

0 commit comments

Comments
 (0)