 		{
 			const int ii = threadIdx.y + blockIdx.y * blockDim.y - rad_v + blockDim.y;
 			const int jj = threadIdx.x + blockIdx.x * blockDim.x - rad_h;
-			if (threadIdx.x < swidth && threadIdx.y + blockDim.y < sheight)
-				if (ii >= 0 && ii < height && jj >= 0 && jj < width)
-					s_source[(threadIdx.y + blockDim.y)*swidth + threadIdx.x]
-					= d_source[ii*width + jj];
+			if (threadIdx.x < swidth && threadIdx.y + blockDim.y < sheight) {
+				if (ii >= 0 && ii < height && jj >= 0 && jj < width) {
+					s_source[(threadIdx.y + blockDim.y)*swidth + threadIdx.x] = d_source[ii*width + jj];
+				}
+			}
 		}
 
 		// 4. right-bottom side

		// 1. left-top side
		const int ii = threadIdx.y + blockIdx.y * blockDim.y - rad_v;
		const int jj = threadIdx.x + blockIdx.x * blockDim.x - rad_h;
		if (ii >= 0 && ii < height && jj >= 0 && jj < width)
			s_source[threadIdx.y*swidth + threadIdx.x] = d_source[ii*width + jj];

		// 2. right side
		// 2 * blockDim.x >= swidth
		{
			const int ii = threadIdx.y + blockIdx.y * blockDim.y - rad_v;
			const int jj = threadIdx.x + blockIdx.x * blockDim.x - rad_h + blockDim.x;
			if (threadIdx.x + blockDim.x < swidth && threadIdx.y < sheight)
				if (ii >= 0 && ii < height && jj >= 0 && jj < width)
					s_source[threadIdx.y*swidth + threadIdx.x + blockDim.x]
					= d_source[ii*width + jj];
		}

		// 3. bottom side

		{
			const int ii = threadIdx.y + blockIdx.y * blockDim.y - rad_v + blockDim.y;
			const int jj = threadIdx.x + blockIdx.x * blockDim.x - rad_h + blockDim.x;
			if (threadIdx.x + blockDim.x < swidth && threadIdx.y + blockDim.y < sheight) {
				if (ii >= 0 && ii < height && jj >= 0 && jj < width) {
					s_source[(threadIdx.y + blockDim.y)*swidth + threadIdx.x + blockDim.x] = d_source[ii*width + jj];
				}
			}
		}
		__syncthreads();

