     const int pxIdxY = blockIdx.z / imgSize;
     const int blockImgIdx = blockIdx.x * B_X * imgsPerThread;
     const int blockFilterIdx = blockIdx.y * B_Y * filtersPerThread;
-
+    
     const int pxIdx = pxIdxY * imgSize + pxIdxX;
-
+    
     const int startPxX = -sizeX/2 + pxIdxX;
     const int startPxY = -sizeX/2 + pxIdxY;
     const int imgIdx = blockImgIdx + threadIdx.x;

 * Horizontal reflection.
 * imgs:    (numColors, imgSize, imgSize, numCases)
 * targets: (numColors, imgSize, imgSize, numCases)
 *
 * targets should be a different array from imgs.
 *
 * Block size: (4, 32)
 * blockIdx.y * 4 + threadIdx.y determines pixel
 * blockIdx.x * 32 * imgsPerThread + threadIdx.x determines case batch
 *
 */
template<int numColors, int imgsPerThread, bool checkCaseBounds>
__global__ void kReflectH(float * imgs, float * targets,
                          const int imgSize, const int numCases) {
    const int pxIdx = blockIdx.y * 4 + threadIdx.y;
    const int imgPixels = imgSize * imgSize;

    if (pxIdx < imgPixels) {
        const int caseIdx = blockIdx.x * 32 * imgsPerThread + threadIdx.x;
        const int pxIdxY = pxIdx / imgSize;

/*
 * blockIdx.y determines module in batches of B_Y
 * blockIdx.x determines filter in batches of B_X * filtersPerThread
 * 
 * weights: (numModules, numColors, filterPixels, numFilters)
 * Not fully coalesced if B_X < 32, so use cache.
 */
