                    << "255" << endl;
                 of.write( (char*)hostPlane_c.data, hostPlane_c.getByteSize() );
                 of.close();
+        #endif
+
+                popart::write_plane2D( ostr.str().c_str(), false, hostPlane_f );
             }
 
-            hostPlane_c.freeHost( popart::Unaligned );
+            hostPlane_f.freeHost( CudaAllocated );
         }
     }
 #endif

                    for( uint32_t i=0; i<ct; i++ ) {
                        int32_t x = roundf( cand[i].xpos );
                        int32_t y = roundf( cand[i].ypos );
                        for( int32_t j=-4; j<=4; j++ ) {
                            hostPlane_c.ptr( clamp(y+j,height) )[ clamp(x,  width) ] = 255;
                            hostPlane_c.ptr( clamp(y,  height) )[ clamp(x+j,width) ] = 255;
                        }
                    }


            int width  = getData(level).getWidth();
            int height = getData(level).getHeight();

            Plane2D_float hostPlane_f;
            hostPlane_f.allocHost( width, height, CudaAllocated );
            hostPlane_f.memcpyFromDevice( getData(level) );

            uint32_t total_ct = 0;

