From e1d545b0eb96f18480ce32bcfd69482f118b6df4 Mon Sep 17 00:00:00 2001 From: jpekkila Date: Thu, 4 Jul 2019 16:16:49 +0300 Subject: [PATCH] Code readability and cleanup (remembered that int3 has + and - operators defined in math_utils.h) --- src/core/astaroth.cu | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/astaroth.cu b/src/core/astaroth.cu index ce41d99..e22e20e 100644 --- a/src/core/astaroth.cu +++ b/src/core/astaroth.cu @@ -56,7 +56,7 @@ gridIdx3d(const Grid& grid, const int idx) idx / (grid.m.x * grid.m.y)}; } -void +static void printInt3(const int3 vec) { printf("(%d, %d, %d)", vec.x, vec.y, vec.z); @@ -268,7 +268,7 @@ AcResult acIntegrateStep(const int& isubstep, const AcReal& dt) { const int3 start = (int3){NGHOST, NGHOST, NGHOST}; - const int3 end = (int3){NGHOST + subgrid.n.x, NGHOST + subgrid.n.y, NGHOST + subgrid.n.z}; + const int3 end = start + subgrid.n; for (int i = 0; i < num_devices; ++i) { rkStep(devices[i], STREAM_PRIMARY, isubstep, start, end, dt); } @@ -295,8 +295,7 @@ acBoundcondStep(void) { acSynchronize(); if (num_devices == 1) { - boundcondStep(devices[0], STREAM_PRIMARY, (int3){0, 0, 0}, - (int3){subgrid.m.x, subgrid.m.y, subgrid.m.z}); + boundcondStep(devices[0], STREAM_PRIMARY, (int3){0, 0, 0}, subgrid.m); } else { // Local boundary conditions