Skip to content

Commit

Permalink
Modification to prevent scalar indexing on CUDA devices
Browse files Browse the repository at this point in the history
Scalar indexing on CUDA devices results in poor performance. This modification uses dot syntax to prevent scalar indexing.
  • Loading branch information
oscarvanderheide authored May 16, 2024
1 parent e5d10e2 commit eef5bd0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lsqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ function lsqr_method!(log::ConvergenceHistory, x, A, b;
n = size(A,2)
length(x) == n || error("x should be of length ", n)
length(b) == m || error("b should be of length ", m)
for i = 1:n
isfinite(x[i]) || error("Initial guess for x must be finite")

if !(all(isfinite.(x)))
error("Initial guess for x must be finite")
end


# Initialize
T = Adivtype(A, b)
Tr = real(T)
Expand Down

0 comments on commit eef5bd0

Please sign in to comment.