[arrayfire] 17/408: Changed unwrap tests to new behavior

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:11:06 UTC 2015


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

ghisvail-guest pushed a commit to branch debian/sid
in repository arrayfire.

commit b3d5bba56ea03e6bafbd7c7525c09ce6d6bed3ea
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Fri Jun 19 13:51:07 2015 -0400

    Changed unwrap tests to new behavior
---
 test/data       |   2 +-
 test/unwrap.cpp | 109 +++++++++++++++++++++++++++++++-------------------------
 2 files changed, 61 insertions(+), 50 deletions(-)

diff --git a/test/data b/test/data
index eaaf0fa..4bf138a 160000
--- a/test/data
+++ b/test/data
@@ -1 +1 @@
-Subproject commit eaaf0fa79ca9f2987a1a95604d6ac67487ecdf6c
+Subproject commit 4bf138a16d715130b88b35e329209f9a60ca3dcb
diff --git a/test/unwrap.cpp b/test/unwrap.cpp
index ca19a10..a108c05 100644
--- a/test/unwrap.cpp
+++ b/test/unwrap.cpp
@@ -40,7 +40,8 @@ typedef ::testing::Types<float, double, cfloat, cdouble, int, unsigned int, char
 TYPED_TEST_CASE(Unwrap, TestTypes);
 
 template<typename T>
-void unwrapTest(string pTestFile, const unsigned resultIdx, const dim_t wx, const dim_t wy, const dim_t sx, const dim_t sy)
+void unwrapTest(string pTestFile, const unsigned resultIdx,
+        const dim_t wx, const dim_t wy, const dim_t sx, const dim_t sy, const dim_t px, const dim_t py)
 {
     if (noDoubleTests<T>()) return;
 
@@ -56,7 +57,7 @@ void unwrapTest(string pTestFile, const unsigned resultIdx, const dim_t wx, cons
 
     ASSERT_EQ(AF_SUCCESS, af_create_array(&inArray, &(in[0].front()), idims.ndims(), idims.get(), (af_dtype) af::dtype_traits<T>::af_type));
 
-    ASSERT_EQ(AF_SUCCESS, af_unwrap(&outArray, inArray, wx, wy, sx, sy));
+    ASSERT_EQ(AF_SUCCESS, af_unwrap(&outArray, inArray, wx, wy, sx, sy, px, py));
 
     // Get result
     T* outData = new T[tests[resultIdx].size()];
@@ -75,49 +76,57 @@ void unwrapTest(string pTestFile, const unsigned resultIdx, const dim_t wx, cons
     if(outArray  != 0) af_release_array(outArray);
 }
 
-#define UNWRAP_INIT(desc, file, resultIdx, x, y, z, w)                                          \
-    TYPED_TEST(Unwrap, desc)                                                                    \
-    {                                                                                           \
-        unwrapTest<TypeParam>(string(TEST_DIR"/unwrap/"#file".test"), resultIdx, x, y, z, w);   \
+#define UNWRAP_INIT(desc, file, resultIdx, wx, wy, sx, sy, px,py)                                           \
+    TYPED_TEST(Unwrap, desc)                                                                                \
+    {                                                                                                       \
+        unwrapTest<TypeParam>(string(TEST_DIR"/unwrap/"#file".test"), resultIdx, wx, wy, sx, sy, px, py);   \
     }
 
-    //UNWRAP_INIT(Unwrap00, unwrap,  0,  3, 3, 1, 1);
-    //UNWRAP_INIT(Unwrap01, unwrap,  1,  4, 4, 1, 1);
-    //UNWRAP_INIT(Unwrap02, unwrap,  2,  5, 5, 1, 1);
-    //UNWRAP_INIT(Unwrap03, unwrap,  3,  5, 5, 5, 5);
-    //UNWRAP_INIT(Unwrap04, unwrap,  4,  6, 6, 1, 1);
-    //UNWRAP_INIT(Unwrap05, unwrap,  5,  9, 9, 1, 1);
-    //UNWRAP_INIT(Unwrap06, unwrap,  6, 16,16, 1, 1);
-    //UNWRAP_INIT(Unwrap07, unwrap,  7, 32,32, 1, 1);
-    //UNWRAP_INIT(Unwrap08, unwrap,  8,  8, 2, 1, 1);
-    //UNWRAP_INIT(Unwrap09, unwrap,  9,  4, 5, 1, 1);
-    //UNWRAP_INIT(Unwrap10, unwrap, 10,  8, 4, 1, 1);
-    //UNWRAP_INIT(Unwrap11, unwrap, 11, 10, 5, 1, 1);
-    //UNWRAP_INIT(Unwrap12, unwrap, 12, 32, 2, 1, 1);
-    //UNWRAP_INIT(Unwrap13, unwrap, 13,  2,50, 1, 1);
-    //UNWRAP_INIT(Unwrap14, unwrap, 14, 90, 4, 1, 1);
-
-    UNWRAP_INIT(UnwrapSmall00, unwrap_small,  0,  3, 3, 1, 1);
-    UNWRAP_INIT(UnwrapSmall01, unwrap_small,  1,  4, 4, 1, 1);
-    UNWRAP_INIT(UnwrapSmall02, unwrap_small,  2,  5, 5, 1, 1);
-    UNWRAP_INIT(UnwrapSmall03, unwrap_small,  3,  6, 6, 1, 1);
-    UNWRAP_INIT(UnwrapSmall04, unwrap_small,  4,  8, 8, 1, 1);
-    UNWRAP_INIT(UnwrapSmall05, unwrap_small,  5, 12,12, 1, 1);
-    UNWRAP_INIT(UnwrapSmall06, unwrap_small,  6,  5, 3, 1, 1);
-    UNWRAP_INIT(UnwrapSmall07, unwrap_small,  7, 10, 4, 1, 1);
-    UNWRAP_INIT(UnwrapSmall08, unwrap_small,  8, 15,15, 1, 1);
-    UNWRAP_INIT(UnwrapSmall09, unwrap_small,  9, 12,10, 1, 1);
-
-    UNWRAP_INIT(UnwrapSmall10, unwrap_small, 10,  3, 3,  3, 3);
-    UNWRAP_INIT(UnwrapSmall11, unwrap_small, 11,  4, 4,  4, 4);
-    UNWRAP_INIT(UnwrapSmall12, unwrap_small, 12,  5, 5,  5, 5);
-    UNWRAP_INIT(UnwrapSmall13, unwrap_small, 13,  6, 6,  6, 6);
-    UNWRAP_INIT(UnwrapSmall14, unwrap_small, 14,  8, 8,  8, 8);
-    UNWRAP_INIT(UnwrapSmall15, unwrap_small, 15, 12,12, 12,12);
-    UNWRAP_INIT(UnwrapSmall16, unwrap_small, 16,  5, 3,  5, 3);
-    UNWRAP_INIT(UnwrapSmall17, unwrap_small, 17, 10, 4, 10, 4);
-    UNWRAP_INIT(UnwrapSmall18, unwrap_small, 18, 15,15, 15,15);
-    UNWRAP_INIT(UnwrapSmall19, unwrap_small, 19, 12,10, 12,10);
+    UNWRAP_INIT(UnwrapSmall00, unwrap_small,  0,  3,  3,  1,  1,  0,  0);
+    UNWRAP_INIT(UnwrapSmall01, unwrap_small,  1,  3,  3,  1,  1,  1,  1);
+    UNWRAP_INIT(UnwrapSmall02, unwrap_small,  2,  3,  3,  1,  1,  2,  2);
+    UNWRAP_INIT(UnwrapSmall03, unwrap_small,  3,  3,  3,  2,  2,  0,  0);
+    UNWRAP_INIT(UnwrapSmall04, unwrap_small,  4,  3,  3,  2,  2,  1,  1);
+    UNWRAP_INIT(UnwrapSmall05, unwrap_small,  5,  3,  3,  2,  2,  2,  2);
+    UNWRAP_INIT(UnwrapSmall06, unwrap_small,  6,  3,  3,  3,  3,  0,  0);
+    UNWRAP_INIT(UnwrapSmall07, unwrap_small,  7,  3,  3,  3,  3,  1,  1);
+    UNWRAP_INIT(UnwrapSmall08, unwrap_small,  8,  3,  3,  3,  3,  2,  2);
+    UNWRAP_INIT(UnwrapSmall09, unwrap_small,  9,  4,  4,  1,  1,  0,  0);
+    UNWRAP_INIT(UnwrapSmall10, unwrap_small, 10,  4,  4,  1,  1,  1,  1);
+    UNWRAP_INIT(UnwrapSmall11, unwrap_small, 11,  4,  4,  1,  1,  2,  2);
+    UNWRAP_INIT(UnwrapSmall12, unwrap_small, 12,  4,  4,  1,  1,  3,  3);
+    UNWRAP_INIT(UnwrapSmall13, unwrap_small, 13,  4,  4,  2,  2,  0,  0);
+    UNWRAP_INIT(UnwrapSmall14, unwrap_small, 14,  4,  4,  2,  2,  1,  1);
+    UNWRAP_INIT(UnwrapSmall15, unwrap_small, 15,  4,  4,  2,  2,  2,  2);
+    UNWRAP_INIT(UnwrapSmall16, unwrap_small, 16,  4,  4,  2,  2,  3,  3);
+    UNWRAP_INIT(UnwrapSmall17, unwrap_small, 17,  4,  4,  4,  4,  0,  0);
+    UNWRAP_INIT(UnwrapSmall18, unwrap_small, 18,  4,  4,  4,  4,  1,  1);
+    UNWRAP_INIT(UnwrapSmall19, unwrap_small, 19,  4,  4,  4,  4,  2,  2);
+    UNWRAP_INIT(UnwrapSmall20, unwrap_small, 20,  4,  4,  4,  4,  3,  3);
+    UNWRAP_INIT(UnwrapSmall21, unwrap_small, 21,  5,  5,  1,  1,  0,  0);
+    UNWRAP_INIT(UnwrapSmall22, unwrap_small, 22,  5,  5,  1,  1,  1,  1);
+    UNWRAP_INIT(UnwrapSmall23, unwrap_small, 23,  5,  5,  5,  5,  0,  0);
+    UNWRAP_INIT(UnwrapSmall24, unwrap_small, 24,  5,  5,  5,  5,  1,  1);
+    UNWRAP_INIT(UnwrapSmall25, unwrap_small, 25,  8,  8,  1,  1,  0,  0);
+    UNWRAP_INIT(UnwrapSmall26, unwrap_small, 26,  8,  8,  1,  1,  7,  7);
+    UNWRAP_INIT(UnwrapSmall27, unwrap_small, 27,  8,  8,  8,  8,  0,  0);
+    UNWRAP_INIT(UnwrapSmall28, unwrap_small, 28,  8,  8,  8,  8,  7,  7);
+    UNWRAP_INIT(UnwrapSmall29, unwrap_small, 29, 12, 12,  1,  1,  0,  0);
+    UNWRAP_INIT(UnwrapSmall30, unwrap_small, 30, 12, 12,  1,  1,  2,  2);
+    UNWRAP_INIT(UnwrapSmall31, unwrap_small, 31, 12, 12, 12, 12,  0,  0);
+    UNWRAP_INIT(UnwrapSmall32, unwrap_small, 32, 12, 12, 12, 12,  2,  2);
+    UNWRAP_INIT(UnwrapSmall33, unwrap_small, 33, 16, 16,  1,  1,  0,  0);
+    UNWRAP_INIT(UnwrapSmall34, unwrap_small, 34, 16, 16, 16, 16,  0,  0);
+    UNWRAP_INIT(UnwrapSmall35, unwrap_small, 35, 16, 16, 16, 16, 15, 15);
+    UNWRAP_INIT(UnwrapSmall36, unwrap_small, 36, 31, 31,  8,  8, 15, 15);
+    UNWRAP_INIT(UnwrapSmall37, unwrap_small, 37,  8, 12,  1,  1,  0,  0);
+    UNWRAP_INIT(UnwrapSmall38, unwrap_small, 38,  8, 12,  1,  1,  7, 11);
+    UNWRAP_INIT(UnwrapSmall39, unwrap_small, 39,  8, 12,  8, 12,  0,  0);
+    UNWRAP_INIT(UnwrapSmall40, unwrap_small, 40,  8, 12,  8, 12,  7, 11);
+    UNWRAP_INIT(UnwrapSmall41, unwrap_small, 41, 15, 10,  1,  1,  0,  0);
+    UNWRAP_INIT(UnwrapSmall42, unwrap_small, 42, 15, 10,  1,  1, 14,  9);
+    UNWRAP_INIT(UnwrapSmall43, unwrap_small, 43, 15, 10, 15, 10,  0,  0);
+    UNWRAP_INIT(UnwrapSmall44, unwrap_small, 44, 15, 10, 15, 10, 14,  9);
 
 ///////////////////////////////// CPP ////////////////////////////////////
 //
@@ -125,11 +134,13 @@ TEST(Unwrap, CPP)
 {
     if (noDoubleTests<float>()) return;
 
-    const unsigned resultIdx = 0;
-    const unsigned wx = 3;
-    const unsigned wy = 3;
-    const unsigned sx = 1;
-    const unsigned sy = 1;
+    const unsigned resultIdx = 20;
+    const unsigned wx = 4;
+    const unsigned wy = 4;
+    const unsigned sx = 4;
+    const unsigned sy = 4;
+    const unsigned px = 3;
+    const unsigned py = 3;
 
     vector<af::dim4> numDims;
     vector<vector<float> > in;
@@ -138,7 +149,7 @@ TEST(Unwrap, CPP)
 
     af::dim4 idims = numDims[0];
     af::array input(idims, &(in[0].front()));
-    af::array output = af::unwrap(input, wx, wy, sx, sy);
+    af::array output = af::unwrap(input, wx, wy, sx, sy, px, py);
 
     // Get result
     float* outData = new float[tests[resultIdx].size()];

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