           signals,
           vCutsSize );
 }
-
-__global__
-void computeResultAllNearbyPoints(
-    const int                          tagIndex,
-    const int                          vCutsSize,
-    NearbyPoint*                       point_buffer,
-    const identification::CutStruct*   cut_buffer,
-    identification::CutSignals*        sig_buffer )
-{
-    const size_t gridNSample = tagParam.gridNSample;
-    const int    i           = blockIdx.x * 32 + threadIdx.x;
-    const int    j           = blockIdx.y * 32 + threadIdx.y;
-    const int    idx         = j * gridNSample + i;
-
-    identification::CutSignals* signals = &sig_buffer[idx * vCutsSize];
-    NearbyPoint* const          nPoint  = &point_buffer[idx];
-
-    const int numPairs = vCutsSize*(vCutsSize-1)/2;
-    dim3 block( 32, // we use this to sum up signals
-                32, // we can use some shared memory/warp magic for summing
-                1 );
-    dim3 grid( grid_divide( numPairs, 32 ), 1, 1 );
-
-    popart::identification::idComputeResult
-        <<<grid,block>>>
-        ( tagIndex, nPoint, cut_buffer, signals, vCutsSize );
-}
-
-#if 0
-__global__
-void validateSignals( size_t                             gridNSample,
-                      const int                          vCutsSize,
-                      NearbyPoint*       point_buffer,
-                      const identification::CutStruct*   cut_buffer,
-                      identification::CutSignals*        sig_buffer )
-{
-    for( int i = 0; i<gridNSample; i++ ) {
-        for( int j = 0; j<gridNSample; j++ ) {
-            int idx = j * gridNSample + i;
-            NearbyPoint* nPoint  = &point_buffer[idx];
-	    printf("point (%.3f,%.3f)\n", nPoint->point.x, nPoint->point.y);
-            for( int cut = 0; cut<vCutsSize; cut++ ) {
-                const identification::CutStruct*  cutptr  = &cut_buffer[cut];
-                identification::CutSignals* signals = &sig_buffer[idx * vCutsSize+cut];
-		int n   = cutptr->sigSize;
-		int oob = signals->outOfBounds;
-		printf("    cut %d has sigSize %d is out of bounds: %d\n", cut, n, oob );
-		if( not oob ) {
-		    printf("    %.3f - %.3f\n", signals[0], signals[n-1] );
-		}
-            }
-	}
-    }
-}
-#endif
 
 __global__
 void idBestNearbyPoint32plus( NearbyPoint* point_buffer, const size_t gridSquare )

    ellipse.projectiveTransform( mInvT, transformedEllipse );

    bool first_iteration = true;
    for( ; iterations>0; iterations-- ) {
        float neighSize = currentNeighbourSize * max( transformedEllipse.a(),
                                                      transformedEllipse.b() );


    neighbourSize = params._imagedCenterNeighbourSize;

    float  residual;
    float2 bestPointOut;
    residual = idCostFunction( tagIndex,
                               iterations,
                               outerEllipse,
                               center,
                               vCutSize,
                               neighbourSize,
                               bestPointOut,
                               bestHomographyOut,
                               params,
                               cctag_pointer_buffer );

    if( residual == FLT_MAX ) return false;
    center        =  bestPointOut;
    neighbourSize /= (float)((gridNSample-1)/2) ;
    return true;
}

