     dual_energies_.reset(new ImageGpu32fC1(size_));
   }
 
+  Pixel32fC1 ep_min, ep_max, ed_min, ed_max;
+
   k_rofPrimalEnergy
       <<<
          this->dimGrid(), this->dimBlock()


  // TODO sum
  primal_energy = 10.0;
  //imp::cu::minMax(primal_energies_, )
  IMP_CUDA_CHECK();

  k_rofDualEnergy

           size_.width(), size_.height(), params_.lambda,
           *f_tex_, *p_tex_);
  dual_energy = 20.0;
  imp::cu::minMax(*dual_energies_, ed_min, ed_max);

  std::cout << "!!! primal: min: " << ep_min << "; max: " << ep_max << std::endl;
  std::cout << "!!! dual  : min: " << ed_min << "; max: " << ed_max << std::endl;

  IMP_CUDA_CHECK();
}
