                                                 ceilf( h * scaleFactor ),
                                                 _config.scaling_mode );
 
+    cudaDeviceSynchronize();
+    cudaEventRecord( end, 0 );
+    cudaEventSynchronize( end );
+    float elapsedTime;
+    cudaEventElapsedTime( &elapsedTime, start, end );
+
+    cerr << "Initialization of pipe " << pipe << " took " << elapsedTime << " ms" << endl;
+
     return true;
 }
 


bool PopSift::init( int pipe, int w, int h )
{
    if( pipe < 0 && pipe >= MAX_PIPES ) {
        return false;
    }

{
    if( pipe < 0 && pipe >= MAX_PIPES ) return;

    cudaEvent_t start, end;
    cudaEventCreate( &start );
    cudaEventCreate( &end );
    cudaDeviceSynchronize();
    cudaEventRecord( start, 0 );

    assert( inp.data_g == 0 );
    assert( inp.data_b == 0 );

