diff --git a/src/ITensorGPU.jl b/src/ITensorGPU.jl index af8696e..b0d532f 100644 --- a/src/ITensorGPU.jl +++ b/src/ITensorGPU.jl @@ -12,6 +12,8 @@ function randomCuITensor(args...; kwargs...) end export cuITensor, randomCuITensor +# TODO: Change over to `using ITensorMPS` +# once it is registered. using ITensors.ITensorMPS: MPO, MPS, randomMPS function CuMPS(args...; kwargs...) return cu(MPS(args...; kwargs...)) diff --git a/test/runtests.jl b/test/runtests.jl index 751fc3a..3058712 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,31 +4,52 @@ end using ITensorGPU, Test, CUDA -if !CUDA.has_cuda() - println("System does not have CUDA, skipping test.") -else - println("Running ITensorGPU tests with a runtime CUDA version: $(CUDA.runtime_version())") - - CUDA.allowscalar(false) - @testset "ITensorGPU.jl" begin - #@testset "$filename" for filename in ("test_cucontract.jl",) - # println("Running $filename with autotune") - # cmd = `$(Base.julia_cmd()) -e 'using Pkg; Pkg.activate(".."); Pkg.instantiate(); include("test_cucontract.jl")'` - # run(pipeline(setenv(cmd, "CUTENSOR_AUTOTUNE" => 1); stdout=stdout, stderr=stderr)) - #end - @testset "$filename" for filename in ( - "test_dmrg.jl", - "test_cuitensor.jl", - "test_cudiag.jl", - "test_cudense.jl", - "test_cucontract.jl", - "test_cumpo.jl", - "test_cumps.jl", - "test_cutruncate.jl", - #"test_pastaq.jl", +@testset "ITensorGPU.jl" begin + @testset "Test exports" begin + @test issetequal( + names(ITensorGPU), + [ + :ITensorGPU, + :cpu, + :cu, + :cuITensor, + :cuMPO, + :cuMPS, + :productCuMPS, + :randomCuITensor, + :randomCuMPO, + :randomCuMPS, + ], + ) + end + if !CUDA.has_cuda() + println("System does not have CUDA, skipping test.") + else + println( + "Running ITensorGPU tests with a runtime CUDA version: $(CUDA.runtime_version())" ) - println("Running $filename") - include(filename) + + CUDA.allowscalar(false) + @testset "ITensorGPU.jl" begin + #@testset "$filename" for filename in ("test_cucontract.jl",) + # println("Running $filename with autotune") + # cmd = `$(Base.julia_cmd()) -e 'using Pkg; Pkg.activate(".."); Pkg.instantiate(); include("test_cucontract.jl")'` + # run(pipeline(setenv(cmd, "CUTENSOR_AUTOTUNE" => 1); stdout=stdout, stderr=stderr)) + #end + @testset "$filename" for filename in ( + "test_dmrg.jl", + "test_cuitensor.jl", + "test_cudiag.jl", + "test_cudense.jl", + "test_cucontract.jl", + "test_cumpo.jl", + "test_cumps.jl", + "test_cutruncate.jl", + #"test_pastaq.jl", + ) + println("Running $filename") + include(filename) + end end end end