Skip to content

Commit

Permalink
fix CUDA runtests
Browse files Browse the repository at this point in the history
  • Loading branch information
ytdHuang committed Sep 11, 2024
1 parent 0c7d58f commit f717463
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ We can easily pass the computation to the GPU, by simply passing all the `Qobj`s
```julia
using QuantumToolbox
using CUDA
CUDA.allowscalar(false) # Avoid unexpected scalar indexing

a_gpu = cu(destroy(N)) # The only difference in the code is the cu() function

Expand Down
1 change: 1 addition & 0 deletions docs/src/users_guide/extensions/cuda.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This extension will be automatically loaded if user imports both `QuantumToolbox
using QuantumToolbox
using CUDA
using CUDA.CUSPARSE
CUDA.allowscalar(false) # Avoid unexpected scalar indexing
```

We wrapped several functions in `CUDA` and `CUDA.CUSPARSE` in order to not only converting `QuantumObject.data` into GPU arrays, but also changing the element type and word size (`32` and `64`) since some of the GPUs perform better in `32`-bit. The functions are listed as follows (where input `A` is a [`QuantumObject`](@ref)):
Expand Down
1 change: 1 addition & 0 deletions test/cuda_ext.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using CUDA
using CUDA.CUSPARSE
CUDA.allowscalar(false) # Avoid unexpected scalar indexing

QuantumToolbox.about()
CUDA.versioninfo()
Expand Down

0 comments on commit f717463

Please sign in to comment.