       // index for thrust computation =
       outindex = x + y * imageSize;
       // printf("hit: outval: %f %f %f %f %d %d %f %f %f nl: %d oi:
-      // %d\n",outval.x, outval.y, outval.z, outval.w, x, y, seedval.x,
+      // %d\n",outval.x, outval.y, outval.z, outval.width, x, y, seedval.x,
       // seedval.y, seedval.z,num_labels, outindex);
       // printf("hit: outval: %f %f %f %f %d %d\n",outval.x, outval.y, outval.z,
-      // outval.w, x, y);
+      // outval.width, x, y);
       // break;
     }
     else
     {
       // printf("not hit: outval: %f %f %f %f %d %d %f %f %f \n",outval.x,
-      // outval.y, outval.z, outval.w, x, y, seedval.x, seedval.y, seedval.z);
+      // outval.y, outval.z, outval.width, x, y, seedval.x, seedval.y, seedval.z);
     }
     idptr[i] = int(seedval.x);
     idxptr[i] = int(seedval.y) + int(seedval.z) * imageSize;

        continue;

      int newindex = v * w + u;
      int new_nearest = data[newindex];
      int new_y = new_nearest / w;
      int new_x = new_nearest - new_y * w;
      float new_w = (new_nearest < w * h) ? occupancy[new_nearest] : 0.0f;
      float new_dist =
          sqrtf(float((x - new_x) * (x - new_x) + (y - new_y) * (y - new_y))) -
          new_w;

      if (new_dist < cur_dist || cur_nearest >= w * h)
      {
        cur_dist = new_dist;
        cur_nearest = new_nearest;
      }
    }
  }

  data[index] = cur_nearest;
}

__global__ void /*__launch_bounds__(16)*/ jfa_thrust_gather(int imageSize,


  int index = y * w + x;

  int currentNearest = data[index];
  int currentY = currentNearest / w;
  int currentX = currentNearest - currentY * w;
  float curr_w = (currentNearest < w * h) ? occupancy[currentNearest] : 0.0f;

  float currentDistance =
      sqrtf(float((x - currentX) * (x - currentX) + (y - currentY) * (y - currentY))) -
      curr_w;

#pragma unroll
