diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-01-20 11:00:23 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-01-20 11:00:23 -0500 |
commit | be371182348018905b897b47f3720940d426d516 (patch) | |
tree | cfa8b60b51280c728036b2cd2e7637aed5808aac /Carpet | |
parent | 16d80f8fc9ed668c9f734946b03c53ae3b432c2a (diff) |
LoopControl: Correct indexing error with vectorisation
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/LoopControl/src/loopcontrol.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Carpet/LoopControl/src/loopcontrol.h b/Carpet/LoopControl/src/loopcontrol.h index 5b954db17..00d0ce8ca 100644 --- a/Carpet/LoopControl/src/loopcontrol.h +++ b/Carpet/LoopControl/src/loopcontrol.h @@ -144,10 +144,12 @@ extern "C" { ptrdiff_t imax = lc_fmax0; \ int const lc_fmin0_is_outer = lc_fmin0 == lc_control.loop.min.v[0]; \ int const lc_fmax0_is_outer = lc_fmax0 == lc_control.loop.max.v[0]; \ - ptrdiff_t const lc_ipos = lc_fmin0 + lc_ash0 * (j + lc_ash1 * k); \ - ptrdiff_t const lc_ioffset = lc_ipos % lc_align0; \ - lc_fmin0 -= lc_ioffset; \ - if (!lc_fmax0_is_outer) lc_fmax0 -= lc_ioffset; \ + ptrdiff_t const lc_iminpos = lc_fmin0 + lc_ash0 * (j + lc_ash1 * k); \ + ptrdiff_t const lc_iminoffset = lc_iminpos % lc_align0; \ + ptrdiff_t const lc_imaxpos = lc_fmax0 + lc_ash0 * (j + lc_ash1 * k); \ + ptrdiff_t const lc_imaxoffset = lc_imaxpos % lc_align0; \ + lc_fmin0 -= lc_iminoffset; \ + if (!lc_fmax0_is_outer) lc_fmax0 -= lc_imaxoffset; \ if (!lc_fmin0_is_outer) imin = lc_fmin0; \ if (!lc_fmax0_is_outer) imax = lc_fmax0; #endif |