     const int blockFilterIdx = filtersPerThread * B_Y * (blockIdx.y % blocksPerModule);
 
     const int numModules = numModulesX * numModulesY;
-    // Another fun insanity: the % B_X makes things faster, even thought threadIdx.x is
+    // Another fun insanity: the % B_X makes things faster, even though threadIdx.x is
     // in the range 0..31. It appears that this allows the compiler to optimize?
     const int tx = threadIdx.x % B_X;
     const int ty = threadIdx.y % B_Y;

        }

        __syncthreads();
        const float* ff = &filters[numFilters * fPidxNext];
        const float* mm = &images[imgStride * iPidxNext];

        FA_COLOR3_IMPRELOAD(2,2);

        #pragma unroll
        for (int pp = 0; pp < 2; pp++) {
            #pragma unroll
            for(int i = 0; i < imgsPerThread; i++) {
                #pragma unroll
                for(int f = 0; f < filtersPerThread; f++) {
                    prod[i][f] += shImages[0][pp][tx * imgsPerThread + i] * shFilters[0][pp][ty * filtersPerThread + f];
                }
            }
        }

        FA_COLOR3_IMPRELOAD(0,0);
        FA_COLOR3_IMPRELOAD(2,0);
        FA_COLOR3_IMPRELOAD(1,0);

        #pragma unroll
        for (int pp = 0; pp < 2; pp++) {
            #pragma unroll
            for(int i = 0; i < imgsPerThread; i++) {
                #pragma unroll
                for(int f = 0; f < filtersPerThread; f++) {
                    prod[i][f] += shImages[1][pp][tx * imgsPerThread + i] * shFilters[1][pp][ty * filtersPerThread + f];
                }
            }
        }

        FA_COLOR3_IMPRELOAD(0,3);
        FA_COLOR3_IMPRELOAD(1,3);
        FA_COLOR3_IMPRELOAD(2,3);

        #pragma unroll
        for(int i = 0; i < imgsPerThread; i++) {
            #pragma unroll
            for(int f = 0; f < filtersPerThread; f++) {
                prod[i][f] += shImages[2][0][tx * imgsPerThread + i] * shFilters[2][0][ty * filtersPerThread + f];
            }
        }


        FA_COLOR3_IMPRELOAD(1,2);
        FA_COLOR3_IMPRELOAD(0,2);

        #pragma unroll
        for(int i = 0; i < imgsPerThread; i++) {
            #pragma unroll
            for(int f = 0; f < filtersPerThread; f++) {
                prod[i][f] += shImages[2][1][tx * imgsPerThread + i] * shFilters[2][1][ty * filtersPerThread + f];
            }
        }

        FA_COLOR3_IMPRELOAD(1,1);
        FA_COLOR3_IMPRELOAD(0,1);
        FA_COLOR3_IMPRELOAD(2,1);

        #pragma unroll
        for (int c = 0; c < numColors; c++) {
            #pragma unroll
            for (int pp = 2; pp < pixelCache; pp++) {
                #pragma unroll
                for(int i = 0; i < imgsPerThread; i++) {
                    #pragma unroll

        #pragma unroll
        for (int i = 0; i < imgsPerThread; i++) {
            if (iPidxNext >= 0 && (!checkImgBounds || myImgIdx + i * B_X < numImages)) {
                imPreload[c][i] = tex1Dfetch<float>(images, imagesOffset + (c * imgPixels + iPidxNext) * imgStride + i * B_X);
            } else {
                imPreload[c][i] =  0;
            }
