 
   // pixel position at the hysteresis image
   int pixIdx = pos.y * size.x + pos.x;
+
+  if (!threadIdx.x) gridUpdate[blockIdx.x] = 0;
 
   // load center
   s_slice[sliceIdx] = hys_img[pixIdx];


    }while(modified_block_pixels);// end inner loop

    hys_img[pixIdx] = s_slice[sliceIdx];

  }while(modified_image_pixels);//end outer loop



}

__global__ void kernel_hysteresis_glm1D(float *hys_img, int3 size, int *gridUpdate){

  __shared__ float s_slice[SLICE_WIDTH*SLICE_WIDTH];
  __shared__ int modified_block_pixels; /// control inner loop
  __shared__ int modified_image_pixels; /// control outer loop
  int gU; // grid Update value
  float edge;

  int gridWidth = (size.x + SLICE_BLOCK_WIDTH) / SLICE_BLOCK_WIDTH;


  // pixel position indexes on slice
  int2 slice_pos;
