 
     if( outOfBounds( x, y, edges ) ) return false;
 
-    ret = edges.ptr(y)[x];
+    uint8_t ret = edges.ptr(y)[x];
     if( ret ) {
         out_edge_info = make_int4( idx, idy, x, y );
         return true;

        const float dy2 = d_dy.ptr(idy)[idx];
        const float compdir = dx2*dxRef+dy2*dyRef;
        // dir = ( compdir < 0 ) ? -1 : 1;
        dir = d_sign( compdir );
        dx = dir * dx2;
        dy = dir * dy2;
    }
    if( ady > adx ) {
        updateXY(dy,dx,y,x,e,stpY,stpX);

        ( _d_edges, cv::cuda::PtrStepSzb(_d_intermediate) );

    uint32_t edge_counter = 0;
    POP_CUDA_MEMCPY_ASYNC( _d_edge_counter, &edge_count, sizeof(uint32_t), cudaMemcpyHostToDevice, _stream, true );

    thinning_and_store
        <<<grid,block,0,_stream>>>
        ( cv::cuda::PtrStepSzb(_d_intermediate), _d_edges, _d_edge_counter, _edge_max, _d_edgelist );

    POP_CUDA_MEMCPY_ASYNC( &edge_counter, _d_edge_counter, sizeof(uint32_t), cudaMemcpyDeviceToHost, _stream, true );

    // Note: right here, Dynamic Parallelism would avoid blocking.
    cudaStreamSynchronize( _stream );
