Skip to content

Commit 0f57a73

Browse files
committed
polish
1 parent 9a1c0bb commit 0f57a73

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ext/QuantumToolboxCUDAExt.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using QuantumToolbox: makeVal, getVal
55
import QuantumToolbox: _sparse_similar, _convert_eltype_wordsize
66
import CUDA: cu, CuArray, allowscalar, @allowscalar, has_cuda
77
import CUDA.CUSPARSE: CuSparseVector, CuSparseMatrixCSC, CuSparseMatrixCSR, AbstractCuSparseArray
8-
import SparseArrays: SparseVector, SparseMatrixCSC, sparse
8+
import SparseArrays: SparseVector, SparseMatrixCSC, sparse, spzeros
99
import CUDA.Adapt: adapt
1010

1111
export _safe_setindex!
@@ -112,4 +112,5 @@ _sparse_similar(A::CuSparseMatrixCSC, m::Int, n::Int) = CuSparseMatrixCSC(spzero
112112
_sparse_similar(A::CuSparseMatrixCSR, I::AbstractVector, J::AbstractVector, V::AbstractVector, m::Int, n::Int) =
113113
CuSparseMatrixCSR(sparse(I, J, V, m, n))
114114
_sparse_similar(A::CuSparseMatrixCSR, m::Int, n::Int) = CuSparseMatrixCSR(spzeros(eltype(A), m, n))
115+
115116
end

src/steadystate.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ function _steadystate_fourier(
403403
# Create initial vector with GPU support
404404
v0 = _dense_similar(L_0_mat, n_fourier * N)
405405
fill!(v0, zero(T))
406-
allowed_setindex!(v0, weight, n_max*N+1) # Safe GPU indexing
406+
allowed_setindex!(v0, weight, n_max*N+1) # Safe GPU indexing scalar indexing is not allowed in GPU
407407

408408
# Handle preconditioners
409409
(haskey(kwargs, :Pl) || haskey(kwargs, :Pr)) && error("The use of preconditioners must be defined in the solver.")

0 commit comments

Comments
 (0)