   __syncthreads();
 
   // Loop until there are no more points to process
-  for (int xx=0; xx<10; ++xx) {
-  //while (true) {
+  //for (int xx=0; xx<10000; ++xx) {
+      while (true) {
 
       // Outer loop to handle more than 8*1024 points
       // Start by restoring memberarray


    // Look at the neighbors. If the response is higher, replace
    for (size_t i = threadIdx.x; i < nump; i += FilterExtremaThreads) {
      if (minneighbor[i] != 8*1024) {
        if (memberarray[minneighbor[i]] == -1) {
          if (!shouldAdd[minneighbor[i]]) {
            const cv::KeyPoint &p0 = kpts[minneighbor[i]];

  int pitch = inimg.pitch;
  int height = inimg.height;
  float *d_DataA = inimg.d_data;

  float *d_DataB = outimg.d_data;
  float *d_Temp = temp.d_data;
  if (d_DataA == NULL || d_DataB == NULL || d_Temp == NULL) {
