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

Lukas Tönne noreply at git.blender.org
Mon Jan 19 20:48:39 CET 2015


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

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