 #include <stdio.h>
+#include <assert.h>
 #define CHECK(e) { int res = (e); if (res) printf("CUDA ERROR %d\n", res); }
 
 /*#define THRESH -1*/
 #define THRESH 10000
-/*#define WARP_SIZE 32*/
+#define WARP_SIZE 32
 
 texture<unsigned char, 2> imageTex;
 


        filtered[j * width + i] = cache[threadIdx.x][threadIdx.y];

        stride += gridDim.x * gridDim.y * blockDim.x * blockDim.y - width;

        i = (tid + stride) % width;
        j = (tid + stride) / width;

 * TODO List
 *
 * - Resize image to test for speed
 * - Think how this can work for images of any size
 * - Think about bank collisions
 * - Refactor the code
