Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-04-28 13:10:20 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-04-28 13:10:20 +0400
commit44924a2e5e10cf645e2a81e0041defa05b542e83 (patch)
tree71b5fb7f331a8a726fcae5d49755845b77142356 /intern/cycles/util
parent2c592b0d964c3931b7fd0fa99b2efa4baa8f266c (diff)
Cycles: fix for CUDA build.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_math.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index 25d81481d12..33e351c74e9 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -515,15 +515,6 @@ __device_inline void print_float3(const char *label, const float3& a)
printf("%s: %.8f %.8f %.8f\n", label, a.x, a.y, a.z);
}
-__device_inline float reduce_add(const float3& a)
-{
-#ifdef __KERNEL_SSE__
- return (a.x + a.y + a.z);
-#else
- return (a.x + a.y + a.z);
-#endif
-}
-
__device_inline float3 rcp(const float3& a)
{
#ifdef __KERNEL_SSE__
@@ -550,6 +541,15 @@ __device_inline bool is_zero(const float3 a)
#endif
}
+__device_inline float reduce_add(const float3& a)
+{
+#ifdef __KERNEL_SSE__
+ return (a.x + a.y + a.z);
+#else
+ return (a.x + a.y + a.z);
+#endif
+}
+
__device_inline float average(const float3 a)
{
return reduce_add(a)*(1.0f/3.0f);
@@ -783,16 +783,6 @@ __device_inline float4 reduce_add(const float4& a)
}
#endif
-__device_inline float reduce_add(const float4& a)
-{
-#ifdef __KERNEL_SSE__
- float4 h = shuffle<1,0,3,2>(a) + a;
- return _mm_cvtss_f32(shuffle<2,3,0,1>(h) + h); /* todo: efficiency? */
-#else
- return ((a.x + a.y) + (a.z + a.w));
-#endif
-}
-
__device_inline void print_float4(const char *label, const float4& a)
{
printf("%s: %.8f %.8f %.8f %.8f\n", label, a.x, a.y, a.z, a.w);
@@ -811,6 +801,16 @@ __device_inline bool is_zero(const float4& a)
#endif
}
+__device_inline float reduce_add(const float4& a)
+{
+#ifdef __KERNEL_SSE__
+ float4 h = shuffle<1,0,3,2>(a) + a;
+ return _mm_cvtss_f32(shuffle<2,3,0,1>(h) + h); /* todo: efficiency? */
+#else
+ return ((a.x + a.y) + (a.z + a.w));
+#endif
+}
+
__device_inline float average(const float4& a)
{
return reduce_add(a) * 0.25f;