[arrayfire] 06/34: BUGFIX: Fix indexed reductions with complex types in OpenCL backend

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sun Sep 27 14:46:02 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch dfsg-clean
in repository arrayfire.

commit 32cf2978577b4128ae7ff403933c9ae7292c7250
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Fri Sep 18 16:20:34 2015 -0400

    BUGFIX: Fix indexed reductions with complex types in OpenCL backend
---
 src/backend/opencl/kernel/iops.cl | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/backend/opencl/kernel/iops.cl b/src/backend/opencl/kernel/iops.cl
index af7c118..e5546e5 100644
--- a/src/backend/opencl/kernel/iops.cl
+++ b/src/backend/opencl/kernel/iops.cl
@@ -9,10 +9,29 @@
 
 #if CPLX
 #define sabs(in) ((in.x)*(in.x) + (in.y)*(in.y))
-#else
-#define sabs(in) in
+#ifdef MIN_OP
+void binOp(T *lhs, uint *lidx, T rhs, uint ridx)
+{
+    if ((sabs(lhs[0]) > sabs(rhs)) ||
+        (sabs(lhs[0]) == sabs(rhs) && *lidx < ridx)) {
+        *lhs = rhs;
+        *lidx = ridx;
+    }
+}
 #endif
 
+#ifdef MAX_OP
+void binOp(T *lhs, uint *lidx, T rhs, uint ridx)
+{
+    if ((sabs(lhs[0]) < sabs(rhs)) ||
+        (sabs(lhs[0]) == sabs(rhs) && *lidx > ridx)) {
+        *lhs = rhs;
+        *lidx = ridx;
+    }
+}
+#endif
+#else
+#define sabs(in) in
 #ifdef MIN_OP
 void binOp(T *lhs, uint *lidx, T rhs, uint ridx)
 {
@@ -34,3 +53,4 @@ void binOp(T *lhs, uint *lidx, T rhs, uint ridx)
     }
 }
 #endif
+#endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list