You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@inbounds has no effect when applied to an entire function as of Julia 1.7.1. See this issue.
As I have many kernel loops, @inbounds appears frequently. It would be great if I can eliminate some of them. One idea is that I should avoid using explicit indexing range and try to use foreach and in if possible. For handling boundary cells, something like foreach(vector)[3:end-2] can help.
A quick test shows that the code is 4x slower without @inbounds:
Without @inbounds:17.096 ms (1186 allocations:689.38 KiB)
With @inbounds:4.407 ms (1184 allocations:689.34 KiB)
The text was updated successfully, but these errors were encountered:
@inbounds
has no effect when applied to an entire function as of Julia 1.7.1. See this issue.As I have many kernel loops,
@inbounds
appears frequently. It would be great if I can eliminate some of them. One idea is that I should avoid using explicit indexing range and try to useforeach
andin
if possible. For handling boundary cells, something likeforeach(vector)[3:end-2]
can help.A quick test shows that the code is 4x slower without
@inbounds
:The text was updated successfully, but these errors were encountered: