Skip to content

Commit b371a4c

Browse files
Merge remote-tracking branch 'origin/main' into dev/patch-1
2 parents c7d6732 + 3f2eaab commit b371a4c

File tree

10 files changed

+56
-26
lines changed

10 files changed

+56
-26
lines changed

.buildkite/CUDA_Ext.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
steps:
2+
- label: "CUDA Julia {{matrix.version}}"
3+
matrix:
4+
setup:
5+
version:
6+
- "1.10" # oldest
7+
#- "1" # latest
8+
plugins:
9+
- JuliaCI/julia#v1:
10+
version: "{{matrix.version}}"
11+
- JuliaCI/julia-test#v1:
12+
test_args: "--quickfail"
13+
- JuliaCI/julia-coverage#v1:
14+
codecov: true
15+
dirs:
16+
- src
17+
- ext
18+
agents:
19+
queue: "juliagpu"
20+
cuda: "*"
21+
env:
22+
GROUP: "CUDA_Ext"
23+
SECRET_CODECOV_TOKEN: "ZfhQu/IcRLqNyZ//ZNs5sjBPaV76IHfU5gui52Qn+Rp8tOurukqgScuyDt+3HQ4R0hJYBw1/Nqg6jmBsvWSc9NEUx8kGsUJFHfN3no0+b+PFxA8oJkWc9EpyIsjht5ZIjlsFWR3f0DpPqMEle/QyWOPcal63CChXR8oAoR+Fz1Bh8GkokLlnC8F9Ugp9xBlu401GCbyZhvLTZnNIgK5yy9q8HBJnBg1cPOhI81J6JvYpEmcIofEzFV/qkfpTUPclu43WNoFX2DZPzbxilf3fsAd5/+nRkRfkNML8KiN4mnmjHxPPbuY8F5zC/PS5ybXtDpfvaMQc01WApXCkZk0ZAQ==;U2FsdGVkX1+eDT7dqCME5+Ox5i8GvWRTQbwiP/VYjapThDbxXFDeSSIC6Opmon+M8go22Bun3bat6Fzie65ang=="
24+
timeout_in_minutes: 60
25+
if: |
26+
// Don't run Buildkite if the commit message includes the text [skip ci], [ci skip], or [no ci]
27+
// Don't run Buildkite for PR draft
28+
// Only run Buildkite when new commits and PR are made to main branch
29+
build.message !~ /\[skip ci\]/ &&
30+
build.message !~ /\[ci skip\]/ &&
31+
build.message !~ /\[no ci\]/ &&
32+
!build.pull_request.draft &&
33+
(build.branch =~ /main/ || build.pull_request.base_branch =~ /main/)

.buildkite/pipeline.yml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1+
# see: https://github.com/staticfloat/forerunner-buildkite-plugin
12
steps:
2-
- label: "QuantumToolboxCUDAExt"
3+
- label: ":runner: Dynamically launch pipelines"
34
plugins:
4-
- JuliaCI/julia#v1:
5-
version: "1"
6-
- JuliaCI/julia-test#v1:
7-
test_args: "--quickfail"
8-
- JuliaCI/julia-coverage#v1:
9-
dirs:
10-
- src
11-
- ext
5+
- staticfloat/forerunner:
6+
watch:
7+
- ".buildkite/pipeline.yml"
8+
- ".buildkite/CUDA_Ext.yml"
9+
- "src/**"
10+
- "ext/QuantumToolboxCUDAExt.jl"
11+
- "test/runtests.jl"
12+
- "test/cuda_ext.jl"
13+
- "Project.toml"
14+
target: ".buildkite/CUDA_Ext.yml"
1215
agents:
1316
queue: "juliagpu"
14-
cuda: "*"
15-
env:
16-
GROUP: "CUDA_Ext"
17-
SECRET_CODECOV_TOKEN: "ZfhQu/IcRLqNyZ//ZNs5sjBPaV76IHfU5gui52Qn+Rp8tOurukqgScuyDt+3HQ4R0hJYBw1/Nqg6jmBsvWSc9NEUx8kGsUJFHfN3no0+b+PFxA8oJkWc9EpyIsjht5ZIjlsFWR3f0DpPqMEle/QyWOPcal63CChXR8oAoR+Fz1Bh8GkokLlnC8F9Ugp9xBlu401GCbyZhvLTZnNIgK5yy9q8HBJnBg1cPOhI81J6JvYpEmcIofEzFV/qkfpTUPclu43WNoFX2DZPzbxilf3fsAd5/+nRkRfkNML8KiN4mnmjHxPPbuY8F5zC/PS5ybXtDpfvaMQc01WApXCkZk0ZAQ==;U2FsdGVkX1+eDT7dqCME5+Ox5i8GvWRTQbwiP/VYjapThDbxXFDeSSIC6Opmon+M8go22Bun3bat6Fzie65ang=="
18-
timeout_in_minutes: 60
19-
if: |
20-
// Don't run Buildkite if the commit message includes the text [skip tests]
21-
// Don't run Buildkite for PR draft
22-
// Only run Buildkite when new commits and PR are made to main branch
23-
build.message !~ /\[skip tests\]/ &&
24-
!build.pull_request.draft &&
25-
(build.branch =~ /main/ || build.pull_request.base_branch =~ /main/)

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ body:
3737
attributes:
3838
label: Your Environment
3939
description: Please use `QuantumToolbox.about()` or `QuantumToolbox.versioninfo()` to get the information about your environment and paste it here (automatically formatted)
40-
placeholder: "QuantumToolbox Ver. ***\nLinearSolve Ver. ***\nOrdinaryDiffEq Ver. ***\nJulia Version: ***\nOS : ***\nWORD_SIZE: ***\nLIBM : ***\nLLVM : ***\nBLAS : ***"
40+
placeholder: "Julia Ver. ***\nQuantumToolbox Ver. ***\nLinearSolve Ver. ***\nOrdinaryDiffEqCore Ver. ***\nOS : ***\nWORD_SIZE: ***\nLIBM : ***\nLLVM : ***\nBLAS : ***"
4141
render: shell
4242
validations:
4343
required: true

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "QuantumToolbox"
22
uuid = "6c2fb7c5-b903-41d2-bc5e-5a7c320b9fab"
33
authors = ["Alberto Mercurio", "Luca Gravina", "Yi-Te Huang"]
4-
version = "0.13.0"
4+
version = "0.13.1"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ We can easily pass the computation to the GPU, by simply passing all the `Qobj`s
149149
```julia
150150
using QuantumToolbox
151151
using CUDA
152+
CUDA.allowscalar(false) # Avoid unexpected scalar indexing
152153

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

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ We can easily pass the computation to the GPU, by simply passing all the `Qobj`s
103103
```julia
104104
using QuantumToolbox
105105
using CUDA
106+
CUDA.allowscalar(false) # Avoid unexpected scalar indexing
106107

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

docs/src/users_guide/extensions/cuda.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This extension will be automatically loaded if user imports both `QuantumToolbox
1313
using QuantumToolbox
1414
using CUDA
1515
using CUDA.CUSPARSE
16+
CUDA.allowscalar(false) # Avoid unexpected scalar indexing
1617
```
1718

1819
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)):

src/QuantumToolbox.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ import SciMLBase:
2929
ContinuousCallback,
3030
DiscreteCallback
3131
import SciMLOperators: MatrixOperator
32-
import LinearSolve: LinearSolve, LinearProblem, SciMLLinearSolveAlgorithm, KrylovJL_MINRES, KrylovJL_GMRES
32+
import LinearSolve: LinearProblem, SciMLLinearSolveAlgorithm, KrylovJL_MINRES, KrylovJL_GMRES
3333
import DiffEqBase: get_tstops
3434
import DiffEqCallbacks: PeriodicCallback, PresetTimeCallback, TerminateSteadyState
35-
import OrdinaryDiffEqCore: OrdinaryDiffEqCore, OrdinaryDiffEqAlgorithm
35+
import OrdinaryDiffEqCore: OrdinaryDiffEqAlgorithm
3636
import OrdinaryDiffEqTsit5: Tsit5
3737

3838
# other dependencies (in alphabetical order)

src/versioninfo.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ function versioninfo(io::IO = stdout)
2828
io,
2929
"Package information:\n",
3030
"====================================\n",
31+
"Julia Ver. $(VERSION)\n",
3132
"QuantumToolbox Ver. $(_get_pkg_version("QuantumToolbox"))\n",
3233
"LinearSolve Ver. $(_get_pkg_version("LinearSolve"))\n",
3334
"OrdinaryDiffEqCore Ver. $(_get_pkg_version("OrdinaryDiffEqCore"))\n",
3435
)
3536

3637
# print System informations
37-
println(io, "System information:\n", "====================================\n", "Julia Version: $(VERSION)")
38+
println(io, "System information:")
39+
println(io, "====================================")
3840
println(io, """OS : $(OS_name) ($(Sys.MACHINE))""")
3941
println(io, """CPU : $(length(cpu)) × $(cpu[1].model)""")
4042
println(io, """Memory : $(round(Sys.total_memory() / 2 ^ 30, digits=3)) GB""")

test/cuda_ext.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using CUDA
22
using CUDA.CUSPARSE
3+
CUDA.allowscalar(false) # Avoid unexpected scalar indexing
34

45
QuantumToolbox.about()
56
CUDA.versioninfo()

0 commit comments

Comments
 (0)