-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoadError on simple example #331
Comments
There's another issue like this somewhere, but I couldn't find it with a brief check. function f(X::Matrix{Float64})
retval = 1
@turbo for i ∈ eachindex(X)
retval += X[i]
end
[retval]
end Basically, if you're accumulating into an array, it wants that array to be indexed by one of the loops. function f(X::Matrix{Float64})
retval = [1]
@turbo for i ∈ eachindex(X)
retval[1] += X[i]
end
end to function f(X::Matrix{Float64})
retval = [1]
retval_tmp = retval[1]
@turbo for i ∈ eachindex(X)
retval_tmp += X[i]
end
retval[1] = retval_tmp
end or some variant of this, but it seems easy enough to do it manually that spending time on that is a very low priority for me. A PR applying this transform would be welcome, however. |
I'm struggling to understand why this function won't load:
When I try to execute this code in Julia 1.6.2--not execute the f() function--I get:
The text was updated successfully, but these errors were encountered: