 #include "nearby_point.h"
 #include "tag_cut.h"
 
+#undef NO_ATOMIC
+
 using namespace std;
 
 namespace popart {

    if( i >= gridNSample ) return;
    if( j >= gridNSample ) return;


    NearbyPoint* nPoint;
    identification::CutSignals* signals;

    {
        const int idx = j * gridNSample + i;
        nPoint  = &point_buffer[idx];
        signals = &sig_buffer[idx * vCutsSize];
    }

    nPoint->point = make_float2( center.x - halfWidth + i*stepSize,
                                center.y - halfWidth + j*stepSize );

    popart::geometry::matrix3x3  mInvT;
    mT.invert( mInvT ); // note: returns false if it fails
    mInvT.condition( nPoint->point );

    nPoint->result   = 0.0f;
    nPoint->resSize  = 0;
    nPoint->readable = true;

              signal_buffer );
        POP_CHK_CALL_IFSYNC;

        dim3 id_block( 32, // we use this to sum up signals
                       32, // we can use some shared memory/warp magic for summing
                       1 );
#ifdef NO_ATOMIC
        dim3 id_grid( 1,
                      gridNSample,
                      gridNSample );
#else
        const int numPairs = vCutSize*(vCutSize-1)/2;
        dim3 id_grid( grid_divide( numPairs, 32 ),
                gridNSample,
                gridNSample );
#endif

        popart::identification::idComputeResult
            <<<id_grid,id_block,0,_stream>>>
            ( tagIndex, point_buffer, cut_buffer, signal_buffer, vCutSize );

        /* We search for the minimum of gridNSample x gridNSample
         * nearby points. Default for gridNSample is 5.
