[arrayfire] 09/34: TEST: Adding tests for bugs in indexed reductions

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 9b4a8a8868262608e2ab5fdb17c7c443dcc21265
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Fri Sep 18 18:52:03 2015 -0400

    TEST: Adding tests for bugs in indexed reductions
---
 test/ireduce.cpp | 22 ++++++++++++++++++++++
 test/reduce.cpp  | 15 +++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/test/ireduce.cpp b/test/ireduce.cpp
index 17abfcf..aa2b66d 100644
--- a/test/ireduce.cpp
+++ b/test/ireduce.cpp
@@ -143,3 +143,25 @@ TEST(ImaxAll, IndexedBig)
 
     ASSERT_EQ(b, res);
 }
+
+TEST(IReduce, BUG_FIX_1005)
+{
+    const int m = 64;
+    const int n = 100;
+    const int b = 5;
+
+    array in = constant(0, m, n, b);
+    for (int i = 0; i < b; i++) {
+        array tmp = randu(m, n);
+        in(span, span, i) = tmp;
+
+        float val0, val1;
+        unsigned idx0, idx1;
+
+        min<float>(&val0, &idx0, in(span, span, i));
+        min<float>(&val1, &idx1, tmp);
+
+        ASSERT_EQ(val0, val1);
+        ASSERT_EQ(idx0, idx1);
+    }
+}
diff --git a/test/reduce.cpp b/test/reduce.cpp
index 000f1ea..b37be15 100644
--- a/test/reduce.cpp
+++ b/test/reduce.cpp
@@ -561,3 +561,18 @@ TEST(MaxAll, IndexedBig)
 
     ASSERT_EQ(b, res);
 }
+
+TEST(Reduce, KernelName)
+{
+    const int m = 64;
+    const int n = 100;
+    const int b = 5;
+
+    array in = af::constant(0, m, n, b);
+    for (int i = 0; i < b; i++) {
+        array tmp = af::randu(m, n);
+        in(af::span, af::span, i) = tmp;
+        ASSERT_EQ(af::min<float>(in(af::span, af::span, i)),
+                  af::min<float>(tmp));
+    }
+}

-- 
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