[Bf-blender-cvs] [d496b30] master: Disable some debugging options in Eigen to make it more usable in Debug mode.

Lukas Tönne noreply at git.blender.org
Tue Jan 20 09:50:12 CET 2015


Commit: d496b308dbf6f0da9123836e6b27e79c654f6681
Author: Lukas Tönne
Date:   Thu Sep 11 17:49:26 2014 +0200
Branches: master
https://developer.blender.org/rBd496b308dbf6f0da9123836e6b27e79c654f6681

Disable some debugging options in Eigen to make it more usable in Debug
mode.

Eigen can become very slow in debug mode, which is a bit of a problem.
It relies heavily on compiler optimizations to remove function calls
etc. More optimizations may be desirable, possibly putting the implicit
solver into its own little library and enabling optimizations in debug
mode there could help.

===================================================================

M	source/blender/blenkernel/intern/implicit.h
M	source/blender/blenkernel/intern/implicit_eigen.cpp

===================================================================

diff --git a/source/blender/blenkernel/intern/implicit.h b/source/blender/blenkernel/intern/implicit.h
index b305600..ccf90c2 100644
--- a/source/blender/blenkernel/intern/implicit.h
+++ b/source/blender/blenkernel/intern/implicit.h
@@ -48,6 +48,8 @@
 
 //#define IMPLICIT_PRINT_SOLVER_INPUT_OUTPUT
 
+//#define IMPLICIT_ENABLE_EIGEN_DEBUG
+
 BLI_INLINE void implicit_print_matrix_elem(float v)
 {
     printf("%-8.3f", v);
diff --git a/source/blender/blenkernel/intern/implicit_eigen.cpp b/source/blender/blenkernel/intern/implicit_eigen.cpp
index 52648f1..92bf127 100644
--- a/source/blender/blenkernel/intern/implicit_eigen.cpp
+++ b/source/blender/blenkernel/intern/implicit_eigen.cpp
@@ -36,6 +36,13 @@
 //#define USE_EIGEN_CORE
 #define USE_EIGEN_CONSTRAINED_CG
 
+#ifndef IMPLICIT_ENABLE_EIGEN_DEBUG
+#ifdef NDEBUG
+#define IMPLICIT_NDEBUG
+#endif
+#define NDEBUG
+#endif
+
 #include <Eigen/Sparse>
 #include <Eigen/src/Core/util/DisableStupidWarnings.h>
 
@@ -43,6 +50,14 @@
 #include <intern/ConstrainedConjugateGradient.h>
 #endif
 
+#ifndef IMPLICIT_ENABLE_EIGEN_DEBUG
+#ifndef IMPLICIT_NDEBUG
+#undef NDEBUG
+#else
+#undef IMPLICIT_NDEBUG
+#endif
+#endif
+
 #include "MEM_guardedalloc.h"
 
 extern "C" {




More information about the Bf-blender-cvs mailing list