Skip to content

Commit

Permalink
Add @inbounds where it actually matters
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendesignolle committed Jan 8, 2025
1 parent cfdbcbd commit bfda1d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nonlocal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ function _local_bound_correlation_recursive!(
sum!(offset_end, A)
A .*= 2
if marg
for ci CartesianIndices(offset_end)
offset_end[ci] -= A[ci, 1]
@inbounds for ci CartesianIndices(offset_end)
offset_end[ci] -= A[ci, 1] # note this is twice the original A
end
end
offset_end .*= -1
Expand All @@ -78,7 +78,7 @@ function _local_bound_correlation_recursive!(A::Vector, chunk, marg, m, tmp, off
end

function _tensor_contraction!(tmp, A::Array{T,N}, ind, marg) where {T<:Number,N}
for x eachindex(ind)
@inbounds for x eachindex(ind)
if ind[x] == 1
for ci CartesianIndices(tmp)
tmp[ci] += A[ci, x+marg]
Expand Down

0 comments on commit bfda1d1

Please sign in to comment.