Refactoring

This commit is contained in:
André R. Brodtkorb
2018-10-31 15:49:10 +01:00
parent 2d8858e7e6
commit 064027fc0b
7 changed files with 34 additions and 69 deletions

View File

@@ -150,6 +150,7 @@ __global__ void KP07DimsplitKernel(
const unsigned int w = BLOCK_WIDTH;
const unsigned int h = BLOCK_HEIGHT;
const unsigned int gc = 2;
const unsigned int vars = 3;
//Shared memory variables
@@ -181,9 +182,7 @@ __global__ void KP07DimsplitKernel(
__syncthreads();
computeFluxF(Q, Qx, F, g_, dx_, dt_);
__syncthreads();
evolveF<w, h, gc>(Q[0], F[0], dx_, dt_);
evolveF<w, h, gc>(Q[1], F[1], dx_, dt_);
evolveF<w, h, gc>(Q[2], F[2], dx_, dt_);
evolveF<w, h, gc, vars>(Q, F, dx_, dt_);
__syncthreads();
//Set boundary conditions
@@ -200,10 +199,7 @@ __global__ void KP07DimsplitKernel(
computeFluxG(Q, Qx, F, g_, dy_, dt_);
__syncthreads();
evolveG<w, h, gc>(Q[0], F[0], dy_, dt_);
evolveG<w, h, gc>(Q[1], F[1], dy_, dt_);
evolveG<w, h, gc>(Q[2], F[2], dy_, dt_);
evolveG<w, h, gc, vars>(Q, F, dy_, dt_);
__syncthreads();
}
//Step 1 => evolve y first, then x
@@ -213,10 +209,7 @@ __global__ void KP07DimsplitKernel(
__syncthreads();
computeFluxG(Q, Qx, F, g_, dy_, dt_);
__syncthreads();
evolveG<w, h, gc>(Q[0], F[0], dy_, dt_);
evolveG<w, h, gc>(Q[1], F[1], dy_, dt_);
evolveG<w, h, gc>(Q[2], F[2], dy_, dt_);
evolveG<w, h, gc, vars>(Q, F, dy_, dt_);
__syncthreads();
//Set boundary conditions
@@ -230,9 +223,7 @@ __global__ void KP07DimsplitKernel(
__syncthreads();
computeFluxF(Q, Qx, F, g_, dx_, dt_);
__syncthreads();
evolveF<w, h, gc>(Q[0], F[0], dx_, dt_);
evolveF<w, h, gc>(Q[1], F[1], dx_, dt_);
evolveF<w, h, gc>(Q[2], F[2], dx_, dt_);
evolveF<w, h, gc, vars>(Q, F, dx_, dt_);
__syncthreads();
}