Skip to content
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

Remove some UB from examples in performance tips #54221

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/src/manual/performance-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -1446,15 +1446,15 @@ the optimizer from trying to be too clever and defeat our benchmark):
```julia
@noinline function inner(x, y)
s = zero(eltype(x))
for i=eachindex(x)
for i in eachindex(x, y)
@inbounds s += x[i]*y[i]
end
return s
end

@noinline function innersimd(x, y)
s = zero(eltype(x))
@simd for i = eachindex(x)
@simd for i in eachindex(x, y)
@inbounds s += x[i] * y[i]
end
return s
Expand Down