         found = VOTE_LOW;
     }
 
+#ifdef ONE_THREAD_ONLY
+    if( true )
+#else // ONE_THREAD_ONLY
     if( threadIdx.x == 0 )
-    {
-
+#endif // ONE_THREAD_ONLY
+    {
         if( (i == EDGE_LINKING_MAX_EDGE_LENGTH) || (found == CONVEXITY_LOST) || (found == FULL_CIRCLE) ) {
             int convexEdgeSegmentSize = buf.size();
             if (convexEdgeSegmentSize > param_windowSizeOnInnerEllipticSegment) {

#include "frame.h"
#include "assist.h"
#include "recursive_sweep.h"

using namespace std;


    }
};

#ifdef ONE_THREAD_ONLY
// include data in class
#else // ONE_THREAD_ONLY
__shared__ int2  edge_buffer[EDGE_LINKING_MAX_EDGE_LENGTH]; // convexEdgeSegment
__shared__ int   edge_index[2];
#endif // ONE_THREAD_ONLY

struct EdgeBuffer
{
#ifdef ONE_THREAD_ONLY
    int2  edge_buffer[EDGE_LINKING_MAX_EDGE_LENGTH]; // convexEdgeSegment
    int   edge_index[2];
#endif // ONE_THREAD_ONLY
    __device__ inline
    void init( int2 start )
    {
#ifdef ONE_THREAD_ONLY
        edge_buffer[0]    = start;
        edge_index[Left]  = 1;
        edge_index[Right] = 0;
#else // ONE_THREAD_ONLY
        if( threadIdx.x == 0 ) {
            edge_buffer[0]    = start;
            edge_index[Left]  = 1;
            edge_index[Right] = 0;
        }
        __syncthreads();
#endif // ONE_THREAD_ONLY
    }

    __device__ inline
