Skip to content

Commit

Permalink
[documentation] Use CUDA.zeros instead of similar
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Mar 31, 2023
1 parent c1be270 commit 19542fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/src/gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if CUDA.functional()
# Additional vector required for solving triangular systems
n = length(b_gpu)
T = eltype(b_gpu)
z = similar(CuVector{T}, n)
z = CUDA.zeros(T, n)

# Solve Py = x
function ldiv_ic0!(P::CuSparseMatrixCSR, x, y, z)
Expand Down Expand Up @@ -116,7 +116,7 @@ if CUDA.functional()
# Additional vector required for solving triangular systems
n = length(b_gpu)
T = eltype(b_gpu)
z = similar(CuVector{T}, n)
z = CUDA.zeros(T, n)

# Solve Py = x
function ldiv_ilu0!(P::CuSparseMatrixCSR, x, y, z)
Expand Down
4 changes: 2 additions & 2 deletions test/gpu/nvidia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include("gpu.jl")
b_gpu = CuVector(b_cpu)
n = length(b_gpu)
T = eltype(b_gpu)
z = similar(CuVector{T}, n)
z = CUDA.zeros(T, n)
symmetric = hermitian = true

A_gpu = CuSparseMatrixCSC(A_cpu)
Expand Down Expand Up @@ -72,7 +72,7 @@ include("gpu.jl")
b_gpu = CuVector(b_cpu)
n = length(b_gpu)
T = eltype(b_gpu)
z = similar(CuVector{T}, n)
z = CUDA.zeros(T, n)
symmetric = hermitian = false

A_gpu = CuSparseMatrixCSC(A_cpu[:,p])
Expand Down

0 comments on commit 19542fa

Please sign in to comment.