 #endif // (PYRAMID_PRINT_DEBUG==1)
 
     for( uint32_t octave=0; octave<_num_octaves; octave++ ) {
+        Octave& oct_obj   = _octaves[octave];
+
         for( uint32_t level=0; level<_levels; level++ ) {
 
-            const int width  = _octaves[octave].getWidth();
-            const int height = _octaves[octave].getHeight();
-
-            Octave&      oct_obj   = _octaves[octave];
+            const int width  = oct_obj.getWidth();
+            const int height = oct_obj.getHeight();
+
             cudaStream_t oct_str_0 = oct_obj.getStream(0);
 
             if( level == 0 )

__host__
inline void Pyramid::dog_from_blurred( int octave, int level )
{
    Octave&      oct_obj   = _octaves[octave];
    cudaStream_t oct_str_0 = oct_obj.getStream(0);

    const int width  = _octaves[octave].getWidth();
    const int height = _octaves[octave].getHeight();

    dim3 block( 128, 2 );
    dim3 grid;
    grid.x = grid_divide( width,  block.x );
    grid.y = grid_divide( height, block.y );

    gauss::v11::make_dog
        <<<grid,block,0,oct_str_0>>>
        ( oct_obj._data_tex[level],
          oct_obj._data_tex[level-1],
          oct_obj.getDogSurface( ),

                vert_from_interm( octave, level );
            }

            cudaEventRecord( oct_obj.getEventGaussDone( level ), oct_str_0 );
        }
    }

    for( uint32_t octave=0; octave<_num_octaves; octave++ ) {
        for( uint32_t level=1; level<_levels; level++ ) {
            dog_from_blurred( octave, level );
        }
    }
    cudaDeviceSynchronize();
}

} // namespace popart
