Skip to content

Commit 9c25ad4

Browse files
authored
Merge pull request #362 from oscarvanderheide/ovdh_fix_scalar_indexing
Modification to prevent scalar indexing on CUDA devices
2 parents 9a32830 + eef5bd0 commit 9c25ad4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/lsqr.jl

+4-2
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ function lsqr_method!(log::ConvergenceHistory, x, A, b;
9898
n = size(A,2)
9999
length(x) == n || error("x should be of length ", n)
100100
length(b) == m || error("b should be of length ", m)
101-
for i = 1:n
102-
isfinite(x[i]) || error("Initial guess for x must be finite")
101+
102+
if !(all(isfinite.(x)))
103+
error("Initial guess for x must be finite")
103104
end
104105

106+
105107
# Initialize
106108
T = Adivtype(A, b)
107109
Tr = real(T)

0 commit comments

Comments
 (0)