         }
     }
 
-    // Spawn 16 blocks per interest point
-    // - computes unnormalized 128 dimensional descriptor, puts it into d_descriptors in the correct location
-    __global__ void compute_descriptors128(PtrStepf descriptors, const KeyPoint_GPU* features)
+	__global__ void compute_descriptors128(PtrStepf descriptors, const KeyPoint_GPU* features)
     {
         // 2 floats (dx,dy) for each thread (5x5 sample points in each sub-region)
-        __shared__ float s_PATCH[6][6];
         __shared__ float sdx[25];
         __shared__ float sdy[25];
 

    {
        static __device__ bool check(int sum_i, int sum_j, int size)
        {
			#if defined (__CUDA_ARCH__) && __CUDA_ARCH__ >= 200
			typedef double real_t;        
			#else
			typedef float  real_t;
			#endif

			float ratio = (float)size / 9.0f;
	        
			real_t d = 0;

			int dx1 = __float2int_rn(ratio * c_DM[0]);
			int dy1 = __float2int_rn(ratio * c_DM[1]);
			int dx2 = __float2int_rn(ratio * c_DM[2]);
			int dy2 = __float2int_rn(ratio * c_DM[3]);

			real_t t = 0;
			t += tex2D(maskSumTex, sum_j + dx1, sum_i + dy1);
			t -= tex2D(maskSumTex, sum_j + dx1, sum_i + dy2);
			t -= tex2D(maskSumTex, sum_j + dx2, sum_i + dy1);
			t += tex2D(maskSumTex, sum_j + dx2, sum_i + dy2);

			d += t * c_DM[4] / ((dx2 - dx1) * (dy2 - dy1));

            return (d >= 0.5);
        }
    };



        /* Nearest neighbour version (faster) */
        const float win_offset = -(float)(win_size - 1) / 2; 

        // Compute sampling points
        // since grids are 2D, need to compute xBlock and yBlock indices
