     const int shFilterLoadX = tidx % (B_Y * filtersPerThread);
     const int myImgIdx = blockIdx.x * B_X * imgsPerThread + threadIdx.x;
 
-    images += myImgIdx;
-    filters += blockFilterIdx
-            + shFilterLoadY * numFilters + shFilterLoadX;
-    if (!conv) { // NOTE: UNTESTED!
-        filters += moduleIdx * numColors * filterPixels * numFilters;
-    }
+//    images += myImgIdx;
+//    filters += blockFilterIdx
+//            + shFilterLoadY * numFilters + shFilterLoadX;
+//    if (!conv) { // NOTE: UNTESTED!
+//        filters += moduleIdx * numColors * filterPixels * numFilters;
+//    }
+
+    const int imagesOffset = myImgIdx;
+    const int filtersOffset = blockFilterIdx + shFilterLoadY * numFilters + shFilterLoadX
+                            + (conv ? 0 : moduleIdx * numColors * filterPixels * numFilters);
 
     targets += moduleIdx * numImages
             + (blockFilterIdx + threadIdx.y * filtersPerThread) * numImages * numModules

        }

        __syncthreads();

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

        #pragma unroll
        for (int c = 0; c < numColors; c++) {
            #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[c][pp][tx * imgsPerThread + i] * shFilters[c][pp][ty * filtersPerThread + f];
                    }
                }
            }
        }

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

        #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
                    for(int f = 0; f < filtersPerThread; f++) {
                        prod[i][f] += shImages[c][pp][tx * imgsPerThread + i] * shFilters[c][pp][ty * filtersPerThread + f];
                    }
                }
            }
            #pragma unroll
            for (int pp = 0; pp < 2; pp++) {
                fPreload[c][pp] = fPidxNext + pp*(B_X/filtersPerThread) + shFilterLoadY >= filterPixels ? 0 : ff[c * numFilters* filterPixels + pp*(B_X/filtersPerThread) * numFilters];
            }
        }


 */
template <int B_Y, int B_X, int imgsPerThread, int filtersPerThread, int numColors, int pixelCache,
          bool scale, bool checkImgBounds>
//__launch_bounds__(128,3)
__global__ void filterActs_YxX_color_preload_ty_4_tx_32_i_4_f_16_px_4_cc_3_tex(cudaTextureObject_t images, cudaTextureObject_t filters, float* targets,
                                       const int numImages, const int numFilters,
                                       const int imgSizeY, const int imgSizeX, const int filterSize, const int paddingStart,
                                       const int moduleStride,
