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

Lukas Tönne noreply at git.blender.org
Thu Sep 11 18:02:31 CEST 2014


Commit: 330f5f1395ecde4772260208c3cf4010e3c83329
Author: Lukas Tönne
Date:   Thu Sep 11 17:49:26 2014 +0200
Branches: hair_immediate_fixes
https://developer.blender.org/rB330f5f1395ecde4772260208c3cf4010e3c83329

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