[Bf-blender-cvs] [d27eea6] master: Add check for LIKELY/UNLIKELY is CPU only

Campbell Barton noreply at git.blender.org
Sun May 4 23:28:50 CEST 2014


Commit: d27eea6dc6886ff900d62d77863e432d724d4de1
Author: Campbell Barton
Date:   Mon May 5 07:26:49 2014 +1000
https://developer.blender.org/rBd27eea6dc6886ff900d62d77863e432d724d4de1

Add check for LIKELY/UNLIKELY is CPU only

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

M	intern/cycles/util/util_types.h

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

diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h
index eeb472e..38eb85a 100644
--- a/intern/cycles/util/util_types.h
+++ b/intern/cycles/util/util_types.h
@@ -460,7 +460,7 @@ enum InterpolationType {
 /* macros */
 
 /* hints for branch pradiction, only use in code that runs a _lot_ */
-#ifdef __GNUC__
+#if defined(__GNUC__) && defined(__KERNEL_CPU__)
 #  define LIKELY(x)       __builtin_expect(!!(x), 1)
 #  define UNLIKELY(x)     __builtin_expect(!!(x), 0)
 #else




More information about the Bf-blender-cvs mailing list