From 97a648020a9dc39ab05016978042df01e889ff6d Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sat, 22 Oct 2011 06:13:16 -0700 Subject: [PATCH] add prefetching for the sequentiel laplace --- apps/laplace.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/laplace.c b/apps/laplace.c index a892d61b..bd672299 100644 --- a/apps/laplace.c +++ b/apps/laplace.c @@ -219,6 +219,12 @@ int laplace(void *arg) for (i = 1; i < n + 1; i++) { // over all rows for (j = 1; j < m + 1; j++) { +#if !USE_SVM + if (j % CACHE_LINE == 1) { + asm volatile ("movl %0, %%eax" :: "r"(&(NewValues[I + i][J + j])) : "%eax"); + } +#endif + #if 1 NewValues[I + i][J + j] = (OldValues[I + i - 1][J + j] + @@ -241,8 +247,8 @@ int laplace(void *arg) NewValues = OldValues; OldValues = tmp; - //RCCE_TNS_barrier(&RCCE_COMM_WORLD); - RCCE_barrier(&RCCE_COMM_WORLD); + RCCE_TNS_barrier(&RCCE_COMM_WORLD); + //RCCE_barrier(&RCCE_COMM_WORLD); #ifdef _USE_GFX if ((my_rank == 0) && (t % 50 == 0)) {