     if( threadIdx.x != 0 ) return;
 
     /* new oris */
-    float ang[2] = {NINF, NINF};
+    // float ang[2] = {NINF, NINF};
 
     /* smooth histogram */
     for( int iter = 0; iter < 2; iter++ ) {

/*************************************************************
 * V1: device side
 *************************************************************/

/*
 * Compute the keypoint orientations for each extremum


    /* find histogram maximum */
    float maxh = NINF;
    int   binh = 0;
    for (int bin = 0; bin < NBINS_V1; bin++) {
        // maxh = fmaxf(maxh, hist[bin]);
        if( hist[bin] > maxh ) {
            maxh = hist[bin];
            binh = bin;
        }
    }

    {
        float hc = hist[binh];
        float hn = hist[((binh+1+NBINS_V1)%NBINS_V1)];
        float hp = hist[((binh-1+NBINS_V1)%NBINS_V1)];
        float th = compute_angle( binh, hc, hn, hp );

        ext->angle_from_bemap = th;
    }
#if 1
    /* find other peaks, boundary of 80% of max */
    int nangles = 1;

    for( int numloops = 1; numloops < NBINS_V1; numloops++) {
        int bin = ( binh + numloops ) % NBINS_V1;

        float hc = hist[bin];
        float hn = hist[((bin+1+NBINS_V1)%NBINS_V1)];
        float hp = hist[((bin-1+NBINS_V1)%NBINS_V1)];

        /* find if a peak */
        if (hc >= (0.8f * maxh) && hc > hn && hc > hp) {
            int idx = atomicAdd( &mgmt->counter, 1 );
            if( idx >= mgmt->max2 ) break;

            float th = compute_angle( bin, hc, hn, hp );

            ext = &extremum[idx];
            ext->xpos             = x;
            ext->ypos             = y;
            ext->sigma            = sig;
            ext->angle_from_bemap = th;

            nangles++;
            if(nangles > 2) break;
        }
    }
#endif
}

/*************************************************************
