[Bf-blender-cvs] [b3d414c] master: Cycles: Don't inline functions for debug CPU kernel

Sergey Sharybin noreply at git.blender.org
Thu Sep 25 13:16:58 CEST 2014


Commit: b3d414cc216222e115924aa4d6b4ecf43f459d78
Author: Sergey Sharybin
Date:   Fri Sep 12 23:07:12 2014 +0600
Branches: master
https://developer.blender.org/rBb3d414cc216222e115924aa4d6b4ecf43f459d78

Cycles: Don't inline functions for debug CPU kernel

Nobody will use debug mode for benchmarks anyway and this way it's much easier
to set breakpoints on inlined functions to catch all their usages.

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

M	intern/cycles/util/util_types.h

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

diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h
index d7d80e2..7b7e04c 100644
--- a/intern/cycles/util/util_types.h
+++ b/intern/cycles/util/util_types.h
@@ -33,7 +33,11 @@
 
 #ifndef __KERNEL_GPU__
 
-#define ccl_device static inline
+#  ifndef NDEBUG
+#    define ccl_device static inline
+#  else
+#    define ccl_device static
+#  endif
 #define ccl_device_noinline static
 #define ccl_global
 #define ccl_constant
@@ -41,7 +45,11 @@
 
 #if defined(_WIN32) && !defined(FREE_WINDOWS)
 
-#define ccl_device_inline static __forceinline
+#  ifndef NDEBUG
+#    define ccl_device_inline static __forceinline
+#  else
+#    define ccl_device_inline static
+#  endif
 #define ccl_align(...) __declspec(align(__VA_ARGS__))
 #ifdef __KERNEL_64_BIT__
 #define ccl_try_align(...) __declspec(align(__VA_ARGS__))
@@ -50,7 +58,11 @@
 #define ccl_try_align(...) /* not support for function arguments (error C2719) */
 #endif
 #define ccl_may_alias
-#define ccl_always_inline __forceinline
+#  ifndef NDEBUG
+#    define ccl_always_inline __forceinline
+#  else
+#    define ccl_always_inline
+#  endif
 #define ccl_maybe_unused
 
 #else




More information about the Bf-blender-cvs mailing list