From: Sebastian Date: Mon, 15 Sep 2014 19:07:31 +0000 (+0000) Subject: d2q9: fix stupid bugs X-Git-Url: http://sraa.de/git/?a=commitdiff_plain;h=44c1f0a0b26408e08b120b763124a1423a33e239;p=lattice-boltzmann-epiphany.git d2q9: fix stupid bugs --- diff --git a/d2q9/esrc/main.c b/d2q9/esrc/main.c index 89a23af..1a239ce 100644 --- a/d2q9/esrc/main.c +++ b/d2q9/esrc/main.c @@ -18,6 +18,9 @@ static uint8_t dummy_bank2[8192] USED SECTION(".data_bank2"); static uint8_t dummy_bank3[8192] USED SECTION(".data_bank3"); static block_t *block = (void*)0x2000; +/* timer values */ +times_t timers = {0}; + /* barrier structures */ volatile e_barrier_t barriers[CORES]; e_barrier_t *tgt_bars[CORES]; @@ -27,7 +30,7 @@ unsigned int row, col, core; #define READ_TIMER(X) \ do { \ - times[X] = E_CTIMER_MAX - e_ctimer_stop(E_CTIMER_0); \ + timers[X] = E_CTIMER_MAX - e_ctimer_stop(E_CTIMER_0); \ e_ctimer_set(E_CTIMER_0, E_CTIMER_MAX); \ e_ctimer_start(E_CTIMER_0, E_CTIMER_CLK); \ } while(0); @@ -35,7 +38,6 @@ unsigned int row, col, core; int main() { const FLOAT omega = 1.0; - unsigned times[TIMERS] = {0}; /* compile-time checks */ BUILD_BUG(NODES * sizeof(node_t) > 24 * 1024); @@ -94,7 +96,7 @@ int main() READ_TIMER(3); /* collide and stream the bulk */ - collide_stream_bulk(*block, omega); + bulk(*block, omega); READ_TIMER(4); /* stream the boundaries: top, bottom */ diff --git a/d2q9/hsrc/data.c b/d2q9/hsrc/data.c index 678c0a2..35fc2b6 100644 --- a/d2q9/hsrc/data.c +++ b/d2q9/hsrc/data.c @@ -230,7 +230,7 @@ void write_timers(times_t times[CORES_Y][CORES_X], uint32_t iter) for(int x = 0; x < CORES_X; x++) { fprintf(file, "[%d,%d]: ", x, y); for(int t = 0; t < TIMERS; t++) { - fprintf(file, "%8d ", times[t][y][x]); + fprintf(file, "%8d ", times[y][x][t]); } fprintf(file, "\n"); }