Skip to content

Commit

Permalink
Merge pull request #11 from QuantumBFS/jg/cuda-ext
Browse files Browse the repository at this point in the history
Cuda extension
  • Loading branch information
GiggleLiu committed Oct 7, 2023
2 parents e01d6ff + c8db4f4 commit bb7a6ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
name = "YaoToEinsum"
uuid = "9b173c7b-dc24-4dc5-a0e1-adab2f7b6ba9"
authors = ["GiggleLiu <cacate0129@gmail.com> and contributors"]
version = "0.2.0"
version = "0.2.1"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OMEinsum = "ebe7aa44-baf0-506c-a96f-8464559b3922"
Yao = "5872b779-8223-5990-8dd0-5abbb0748c8c"

[weakdeps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"

[extensions]
YaoToEinsumCUDAExt = "CUDA"

[compat]
CUDA = "4, 5"
OMEinsum = "0.7"
Yao = "0.8"
julia = "1"
julia = "1.9"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
7 changes: 7 additions & 0 deletions ext/YaoToEinsumCUDAExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module YaoToEinsumCUDAExt
using CUDA, YaoToEinsum

function CUDA.cu(tnet::TensorNetwork)
return TensorNetwork(tnet.code, tnet.tensors .|> CuArray)
end
end

0 comments on commit bb7a6ec

Please sign in to comment.