aboutsummaryrefslogtreecommitdiff
path: root/Carpet/LoopControl/src
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-01-20 11:00:23 -0500
committerErik Schnetter <schnetter@gmail.com>2013-01-20 11:00:23 -0500
commitbe371182348018905b897b47f3720940d426d516 (patch)
treecfa8b60b51280c728036b2cd2e7637aed5808aac /Carpet/LoopControl/src
parent16d80f8fc9ed668c9f734946b03c53ae3b432c2a (diff)
LoopControl: Correct indexing error with vectorisation
Diffstat (limited to 'Carpet/LoopControl/src')
-rw-r--r--Carpet/LoopControl/src/loopcontrol.h10
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