From 314e36a3cc3b16fb3250a5a22b570ed84f4f13f7 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 14 Jul 2019 23:50:11 -0700 Subject: [PATCH] fix for 1-sized grids --- opencl_fdtd/kernels/common.cl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opencl_fdtd/kernels/common.cl b/opencl_fdtd/kernels/common.cl index deecec9..8c58d48 100644 --- a/opencl_fdtd/kernels/common.cl +++ b/opencl_fdtd/kernels/common.cl @@ -78,7 +78,8 @@ int p{{r}} = + (int) di{{r}}; int wrap_{{r}} = (s{{r}} - 1) * (int) di{{r}}; if ( {{r}} == 0 ) { m{{r}} = wrap_{{r}}; -} else if ( {{r}} == s{{r}} - 1 ) { +} +if ( {{r}} == s{{r}} - 1 ) { p{{r}} = -wrap_{{r}}; -} +} {% endfor %}