From 2a52431cae6d35c53f8db5003df57d95bd2f635f Mon Sep 17 00:00:00 2001 From: couturie Date: Sun, 5 May 2013 14:33:50 +0200 Subject: [PATCH 1/1] correct ch17 --- BookGPU/Chapters/chapter17/ch17.tex | 4 ++-- BookGPU/Chapters/chapter17/code/collem_kernel_diffuse.cl | 3 ++- BookGPU/Chapters/chapter17/code/mior_launcher.java | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/BookGPU/Chapters/chapter17/ch17.tex b/BookGPU/Chapters/chapter17/ch17.tex index 28e8251..4aa06b8 100755 --- a/BookGPU/Chapters/chapter17/ch17.tex +++ b/BookGPU/Chapters/chapter17/ch17.tex @@ -1,7 +1,7 @@ \chapterauthor{Guillaume Laville}{Femto-ST Institute, University of Franche-Comte, France} \chapterauthor{Christophe Lang}{Femto-ST Institute, University of Franche-Comte, France} -\chapterauthor{Kamel Mazouzi}{Femto-ST Institute, University of Franche-Comte, France} -\chapterauthor{Nicolas Marilleau}{Femto-ST Institute, University of Franche-Comte, France} +\chapterauthor{Kamel Mazouzi}{Franche-Comte Computing Center, University of Franche-Comte, France} +\chapterauthor{Nicolas Marilleau}{UMMISCO, Institut de Recherche pour le Développement (IRD), France} \chapterauthor{Bénédicte Herrmann}{Femto-ST Institute, University of Franche-Comte, France} \chapterauthor{Laurent Philippe}{Femto-ST Institute, University of Franche-Comte, France} diff --git a/BookGPU/Chapters/chapter17/code/collem_kernel_diffuse.cl b/BookGPU/Chapters/chapter17/code/collem_kernel_diffuse.cl index 93de319..2bfa979 100644 --- a/BookGPU/Chapters/chapter17/code/collem_kernel_diffuse.cl +++ b/BookGPU/Chapters/chapter17/code/collem_kernel_diffuse.cl @@ -15,7 +15,8 @@ kernel void diffuse( // _syncthreads() in CUDA barrier(CLK_GLOBAL_MEM_FENCE); - // Retrieve neighbors surplus and add them to the current cell population + // Retrieve neighbors surplus and add them to the current cell + // population int surplus = OVERFLOW(world, overflows, i + 1, j) + OVERFLOW(world, overflows, i - 1, j) + OVERFLOW(world, overflows, i, j - 1) + OVERFLOW(world, overflows, i, j + 1); CELL(world, newPopulations, i, j) = CELL(world, populations, i, j) + surplus / 8.0 - OVERFLOW(world, overflows, i, j); diff --git a/BookGPU/Chapters/chapter17/code/mior_launcher.java b/BookGPU/Chapters/chapter17/code/mior_launcher.java index 3b648eb..159b88a 100644 --- a/BookGPU/Chapters/chapter17/code/mior_launcher.java +++ b/BookGPU/Chapters/chapter17/code/mior_launcher.java @@ -3,7 +3,8 @@ protected void doLiveImpl() { simulateKernel.setArguments(mmMem, omMem, worldsMem, mmOffsetsMem, omOffsetsMem, mmCSRMem, omCSRMem, partsMem); if (blockSize < Math.max(nbOM, nbMM)) { - throw new RuntimeException("blockSize (" + blockSize + ") too small to execute the simulation"); + throw new RuntimeException("blockSize (" + blockSize + + ") too small to execute the simulation"); } OCLEvent event = queue.enqueue1DKernel(simulateKernel, nbSim * blockSize, blockSize); @@ -15,6 +16,5 @@ protected void doLiveImpl() { queue.blockingReadBuffer(mmMem, mmList, 0, mmMem.getSize()); queue.blockingReadBuffer(omMem, omList, 0, omMem.getSize()); queue.blockingReadBuffer(worldsMem, worlds, 0, worldsMem.getSize()); - System.out.println("copy"); } } -- 2.39.5