[arrayfire] 148/408: Added 64-bit integer type support for functions

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:11:41 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 c69ca0abdb6c2e006d202db6eafd0f139046973d
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Tue Jul 14 11:53:27 2015 -0400

    Added 64-bit integer type support for functions
    
    * iota
    * range
    * diff1
    * diff2
    * accum
    * join
    * shift
    * tile
---
 src/api/c/data.cpp           | 4 ++++
 src/api/c/diff.cpp           | 4 ++++
 src/api/c/flip.cpp           | 2 ++
 src/api/c/join.cpp           | 2 ++
 src/api/c/scan.cpp           | 2 ++
 src/api/c/shift.cpp          | 2 ++
 src/api/c/tile.cpp           | 2 ++
 src/backend/cpu/diff.cpp     | 2 ++
 src/backend/cpu/iota.cpp     | 2 ++
 src/backend/cpu/range.cpp    | 2 ++
 src/backend/cpu/scan.cpp     | 2 ++
 src/backend/cpu/shift.cpp    | 2 ++
 src/backend/cpu/tile.cpp     | 2 ++
 src/backend/cuda/diff.cu     | 2 ++
 src/backend/cuda/iota.cu     | 2 ++
 src/backend/cuda/range.cu    | 2 ++
 src/backend/cuda/scan.cu     | 2 ++
 src/backend/cuda/shift.cu    | 2 ++
 src/backend/cuda/tile.cu     | 2 ++
 src/backend/opencl/diff.cpp  | 2 ++
 src/backend/opencl/iota.cpp  | 2 ++
 src/backend/opencl/range.cpp | 2 ++
 src/backend/opencl/scan.cpp  | 2 ++
 src/backend/opencl/shift.cpp | 2 ++
 src/backend/opencl/tile.cpp  | 2 ++
 test/diff1.cpp               | 2 +-
 test/diff2.cpp               | 2 +-
 test/iota.cpp                | 2 +-
 test/range.cpp               | 2 +-
 test/scan.cpp                | 6 ++++--
 test/shift.cpp               | 2 +-
 test/tile.cpp                | 2 +-
 32 files changed, 64 insertions(+), 8 deletions(-)

diff --git a/src/api/c/data.cpp b/src/api/c/data.cpp
index 183e69f..50acaad 100644
--- a/src/api/c/data.cpp
+++ b/src/api/c/data.cpp
@@ -468,6 +468,8 @@ af_err af_range(af_array *result, const unsigned ndims, const dim_t * const dims
         case f64:   out = range_<double >(d, seq_dim); break;
         case s32:   out = range_<int    >(d, seq_dim); break;
         case u32:   out = range_<uint   >(d, seq_dim); break;
+        case s64:   out = range_<intl   >(d, seq_dim); break;
+        case u64:   out = range_<uintl  >(d, seq_dim); break;
         case u8:    out = range_<uchar  >(d, seq_dim); break;
         default:    TYPE_ERROR(4, type);
         }
@@ -509,6 +511,8 @@ af_err af_iota(af_array *result, const unsigned ndims, const dim_t * const dims,
         case f64:   out = iota_<double >(d, t); break;
         case s32:   out = iota_<int    >(d, t); break;
         case u32:   out = iota_<uint   >(d, t); break;
+        case s64:   out = iota_<intl   >(d, t); break;
+        case u64:   out = iota_<uintl  >(d, t); break;
         case u8:    out = iota_<uchar  >(d, t); break;
         default:    TYPE_ERROR(4, type);
         }
diff --git a/src/api/c/diff.cpp b/src/api/c/diff.cpp
index c3f8c5c..75ce5d8 100644
--- a/src/api/c/diff.cpp
+++ b/src/api/c/diff.cpp
@@ -52,6 +52,8 @@ af_err af_diff1(af_array *out, const af_array in, const int dim)
             case b8:  output = diff1<char   >(in,dim);  break;
             case s32: output = diff1<int    >(in,dim);  break;
             case u32: output = diff1<uint   >(in,dim);  break;
+            case s64: output = diff1<intl   >(in,dim);  break;
+            case u64: output = diff1<uintl  >(in,dim);  break;
             case u8:  output = diff1<uchar  >(in,dim);  break;
             default:  TYPE_ERROR(1, type);
         }
@@ -85,6 +87,8 @@ af_err af_diff2(af_array *out, const af_array in, const int dim)
             case b8:  output = diff2<char   >(in,dim);  break;
             case s32: output = diff2<int    >(in,dim);  break;
             case u32: output = diff2<uint   >(in,dim);  break;
+            case s64: output = diff2<intl   >(in,dim);  break;
+            case u64: output = diff2<uintl  >(in,dim);  break;
             case u8:  output = diff2<uchar  >(in,dim);  break;
             default:  TYPE_ERROR(1, type);
         }
diff --git a/src/api/c/flip.cpp b/src/api/c/flip.cpp
index b7778e8..a88c217 100644
--- a/src/api/c/flip.cpp
+++ b/src/api/c/flip.cpp
@@ -67,6 +67,8 @@ af_err af_flip(af_array *result, const af_array in, const unsigned dim)
         case b8:     out = flipArray<char>    (in, dim);  break;
         case s32:    out = flipArray<int>     (in, dim);  break;
         case u32:    out = flipArray<unsigned>(in, dim);  break;
+        case s64:    out = flipArray<intl>    (in, dim);  break;
+        case u64:    out = flipArray<uintl>   (in, dim);  break;
         case u8:     out = flipArray<uchar>   (in, dim);  break;
         default:    TYPE_ERROR(1, in_type);
         }
diff --git a/src/api/c/join.cpp b/src/api/c/join.cpp
index 423859c..67035f3 100644
--- a/src/api/c/join.cpp
+++ b/src/api/c/join.cpp
@@ -117,6 +117,8 @@ af_err af_join_many(af_array *out, const int dim, const unsigned n_arrays, const
             case b8:  output = join_many<char   >(dim, n_arrays, inputs);  break;
             case s32: output = join_many<int    >(dim, n_arrays, inputs);  break;
             case u32: output = join_many<uint   >(dim, n_arrays, inputs);  break;
+            case s64: output = join_many<intl   >(dim, n_arrays, inputs);  break;
+            case u64: output = join_many<uintl  >(dim, n_arrays, inputs);  break;
             case u8:  output = join_many<uchar  >(dim, n_arrays, inputs);  break;
             default:  TYPE_ERROR(1, info[0].getType());
         }
diff --git a/src/api/c/scan.cpp b/src/api/c/scan.cpp
index 34f4c89..d0c9e8e 100644
--- a/src/api/c/scan.cpp
+++ b/src/api/c/scan.cpp
@@ -51,6 +51,8 @@ af_err af_accum(af_array *out, const af_array in, const int dim)
         case c64:  res = scan<af_add_t, cdouble, cdouble>(in, dim); break;
         case u32:  res = scan<af_add_t, uint   , uint   >(in, dim); break;
         case s32:  res = scan<af_add_t, int    , int    >(in, dim); break;
+        case u64:  res = scan<af_add_t, uintl  , uintl  >(in, dim); break;
+        case s64:  res = scan<af_add_t, intl   , intl   >(in, dim); break;
         case u8:   res = scan<af_add_t, uchar  , uint   >(in, dim); break;
         // Make sure you are adding only "1" for every non zero value, even if op == af_add_t
         case b8:   res = scan<af_notzero_t, char  , uint   >(in, dim); break;
diff --git a/src/api/c/shift.cpp b/src/api/c/shift.cpp
index e5c2b83..28e2180 100644
--- a/src/api/c/shift.cpp
+++ b/src/api/c/shift.cpp
@@ -41,6 +41,8 @@ af_err af_shift(af_array *out, const af_array in, const int sdims[4])
             case b8:  output = shift<char   >(in, sdims);  break;
             case s32: output = shift<int    >(in, sdims);  break;
             case u32: output = shift<uint   >(in, sdims);  break;
+            case s64: output = shift<intl   >(in, sdims);  break;
+            case u64: output = shift<uintl  >(in, sdims);  break;
             case u8:  output = shift<uchar  >(in, sdims);  break;
             default:  TYPE_ERROR(1, type);
         }
diff --git a/src/api/c/tile.cpp b/src/api/c/tile.cpp
index 5064677..7d546c2 100644
--- a/src/api/c/tile.cpp
+++ b/src/api/c/tile.cpp
@@ -68,6 +68,8 @@ af_err af_tile(af_array *out, const af_array in, const af::dim4 &tileDims)
             case b8:  output = tile<char   >(in, tileDims);  break;
             case s32: output = tile<int    >(in, tileDims);  break;
             case u32: output = tile<uint   >(in, tileDims);  break;
+            case s64: output = tile<intl   >(in, tileDims);  break;
+            case u64: output = tile<uintl  >(in, tileDims);  break;
             case u8:  output = tile<uchar  >(in, tileDims);  break;
             default:  TYPE_ERROR(1, type);
         }
diff --git a/src/backend/cpu/diff.cpp b/src/backend/cpu/diff.cpp
index 733de8f..907c111 100644
--- a/src/backend/cpu/diff.cpp
+++ b/src/backend/cpu/diff.cpp
@@ -116,6 +116,8 @@ namespace cpu
     INSTANTIATE(cdouble)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
     INSTANTIATE(char)
 }
diff --git a/src/backend/cpu/iota.cpp b/src/backend/cpu/iota.cpp
index e6111e8..668500f 100644
--- a/src/backend/cpu/iota.cpp
+++ b/src/backend/cpu/iota.cpp
@@ -64,5 +64,7 @@ namespace cpu
     INSTANTIATE(double)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
 }
diff --git a/src/backend/cpu/range.cpp b/src/backend/cpu/range.cpp
index 1d04289..f0c8de1 100644
--- a/src/backend/cpu/range.cpp
+++ b/src/backend/cpu/range.cpp
@@ -79,5 +79,7 @@ namespace cpu
     INSTANTIATE(double)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
 }
diff --git a/src/backend/cpu/scan.cpp b/src/backend/cpu/scan.cpp
index cdd359f..9cd4163 100644
--- a/src/backend/cpu/scan.cpp
+++ b/src/backend/cpu/scan.cpp
@@ -104,6 +104,8 @@ namespace cpu
     INSTANTIATE(af_add_t, cdouble, cdouble)
     INSTANTIATE(af_add_t, int    , int    )
     INSTANTIATE(af_add_t, uint   , uint   )
+    INSTANTIATE(af_add_t, intl   , intl   )
+    INSTANTIATE(af_add_t, uintl  , uintl  )
     INSTANTIATE(af_add_t, char   , int    )
     INSTANTIATE(af_add_t, uchar  , uint   )
     INSTANTIATE(af_notzero_t, char  , uint   )
diff --git a/src/backend/cpu/shift.cpp b/src/backend/cpu/shift.cpp
index a9d12b9..eff5c09 100644
--- a/src/backend/cpu/shift.cpp
+++ b/src/backend/cpu/shift.cpp
@@ -78,6 +78,8 @@ namespace cpu
     INSTANTIATE(cdouble)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
     INSTANTIATE(char)
 
diff --git a/src/backend/cpu/tile.cpp b/src/backend/cpu/tile.cpp
index e1ee43f..4ca30d2 100644
--- a/src/backend/cpu/tile.cpp
+++ b/src/backend/cpu/tile.cpp
@@ -67,6 +67,8 @@ namespace cpu
     INSTANTIATE(cdouble)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
     INSTANTIATE(char)
 
diff --git a/src/backend/cuda/diff.cu b/src/backend/cuda/diff.cu
index f7b1a6e..a50ba26 100644
--- a/src/backend/cuda/diff.cu
+++ b/src/backend/cuda/diff.cu
@@ -66,6 +66,8 @@ namespace cuda
     INSTANTIATE(cdouble)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
     INSTANTIATE(char)
 
diff --git a/src/backend/cuda/iota.cu b/src/backend/cuda/iota.cu
index b5aa16c..ee9bcdc 100644
--- a/src/backend/cuda/iota.cu
+++ b/src/backend/cuda/iota.cu
@@ -34,6 +34,8 @@ namespace cuda
     INSTANTIATE(double)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
 }
 
diff --git a/src/backend/cuda/range.cu b/src/backend/cuda/range.cu
index 17e6472..9a1a7cd 100644
--- a/src/backend/cuda/range.cu
+++ b/src/backend/cuda/range.cu
@@ -42,5 +42,7 @@ namespace cuda
     INSTANTIATE(double)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
 }
diff --git a/src/backend/cuda/scan.cu b/src/backend/cuda/scan.cu
index 0a29d6a..a76abc2 100644
--- a/src/backend/cuda/scan.cu
+++ b/src/backend/cuda/scan.cu
@@ -47,6 +47,8 @@ namespace cuda
     INSTANTIATE(af_add_t, cdouble, cdouble)
     INSTANTIATE(af_add_t, int    , int    )
     INSTANTIATE(af_add_t, uint   , uint   )
+    INSTANTIATE(af_add_t, intl   , intl   )
+    INSTANTIATE(af_add_t, uintl  , uintl  )
     INSTANTIATE(af_add_t, char   , int    )
     INSTANTIATE(af_add_t, uchar  , uint   )
     INSTANTIATE(af_notzero_t, char  , uint   )
diff --git a/src/backend/cuda/shift.cu b/src/backend/cuda/shift.cu
index 2d59b39..f97eb4a 100644
--- a/src/backend/cuda/shift.cu
+++ b/src/backend/cuda/shift.cu
@@ -37,6 +37,8 @@ namespace cuda
     INSTANTIATE(cdouble)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
     INSTANTIATE(char)
 }
diff --git a/src/backend/cuda/tile.cu b/src/backend/cuda/tile.cu
index b44d8b9..2a9af87 100644
--- a/src/backend/cuda/tile.cu
+++ b/src/backend/cuda/tile.cu
@@ -42,6 +42,8 @@ namespace cuda
     INSTANTIATE(cdouble)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
     INSTANTIATE(char)
 
diff --git a/src/backend/opencl/diff.cpp b/src/backend/opencl/diff.cpp
index 981062a..cfcd684 100644
--- a/src/backend/opencl/diff.cpp
+++ b/src/backend/opencl/diff.cpp
@@ -71,5 +71,7 @@ namespace opencl
     INSTANTIATE(int)
     INSTANTIATE(uint)
     INSTANTIATE(uchar)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(char)
 }
diff --git a/src/backend/opencl/iota.cpp b/src/backend/opencl/iota.cpp
index 7a1d369..fb98bca 100644
--- a/src/backend/opencl/iota.cpp
+++ b/src/backend/opencl/iota.cpp
@@ -34,5 +34,7 @@ namespace opencl
     INSTANTIATE(double)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
 }
diff --git a/src/backend/opencl/range.cpp b/src/backend/opencl/range.cpp
index 521a4fb..faeb4fa 100644
--- a/src/backend/opencl/range.cpp
+++ b/src/backend/opencl/range.cpp
@@ -42,5 +42,7 @@ namespace opencl
     INSTANTIATE(double)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
 }
diff --git a/src/backend/opencl/scan.cpp b/src/backend/opencl/scan.cpp
index 52b8c9a..ff657a4 100644
--- a/src/backend/opencl/scan.cpp
+++ b/src/backend/opencl/scan.cpp
@@ -52,6 +52,8 @@ namespace opencl
     INSTANTIATE(af_add_t, cdouble, cdouble)
     INSTANTIATE(af_add_t, int    , int    )
     INSTANTIATE(af_add_t, uint   , uint   )
+    INSTANTIATE(af_add_t, intl   , intl   )
+    INSTANTIATE(af_add_t, uintl  , uintl  )
     INSTANTIATE(af_add_t, char   , int    )
     INSTANTIATE(af_add_t, uchar  , uint   )
     INSTANTIATE(af_notzero_t, char  , uint)
diff --git a/src/backend/opencl/shift.cpp b/src/backend/opencl/shift.cpp
index c00033e..5cbb71d 100644
--- a/src/backend/opencl/shift.cpp
+++ b/src/backend/opencl/shift.cpp
@@ -37,6 +37,8 @@ namespace opencl
     INSTANTIATE(cdouble)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
     INSTANTIATE(char)
 }
diff --git a/src/backend/opencl/tile.cpp b/src/backend/opencl/tile.cpp
index 104f4ac..794059d 100644
--- a/src/backend/opencl/tile.cpp
+++ b/src/backend/opencl/tile.cpp
@@ -37,6 +37,8 @@ namespace opencl
     INSTANTIATE(cdouble)
     INSTANTIATE(int)
     INSTANTIATE(uint)
+    INSTANTIATE(intl)
+    INSTANTIATE(uintl)
     INSTANTIATE(uchar)
     INSTANTIATE(char)
 
diff --git a/test/diff1.cpp b/test/diff1.cpp
index 13b6054..7fe19db 100644
--- a/test/diff1.cpp
+++ b/test/diff1.cpp
@@ -46,7 +46,7 @@ class Diff1 : public ::testing::Test
 };
 
 // create a list of types to be tested
-typedef ::testing::Types<float, cfloat, double, cdouble, int, unsigned, char, unsigned char> TestTypes;
+typedef ::testing::Types<float, cfloat, double, cdouble, int, unsigned, intl, uintl, char, unsigned char> TestTypes;
 
 // register the type list
 TYPED_TEST_CASE(Diff1, TestTypes);
diff --git a/test/diff2.cpp b/test/diff2.cpp
index 16b957f..9f7d0cb 100644
--- a/test/diff2.cpp
+++ b/test/diff2.cpp
@@ -46,7 +46,7 @@ class Diff2 : public ::testing::Test
 };
 
 // create a list of types to be tested
-typedef ::testing::Types<float, cfloat, double, cdouble, int, unsigned, char, unsigned char> TestTypes;
+typedef ::testing::Types<float, cfloat, double, cdouble, int, unsigned, intl, uintl, char, unsigned char> TestTypes;
 
 // register the type list
 TYPED_TEST_CASE(Diff2, TestTypes);
diff --git a/test/iota.cpp b/test/iota.cpp
index fae4f72..1c1ca6c 100644
--- a/test/iota.cpp
+++ b/test/iota.cpp
@@ -38,7 +38,7 @@ class Iota : public ::testing::Test
 };
 
 // create a list of types to be tested
-typedef ::testing::Types<float, double, int, unsigned int, unsigned char> TestTypes;
+typedef ::testing::Types<float, double, int, unsigned int, intl, uintl, unsigned char> TestTypes;
 
 // register the type list
 TYPED_TEST_CASE(Iota, TestTypes);
diff --git a/test/range.cpp b/test/range.cpp
index bd09137..6d7d9b7 100644
--- a/test/range.cpp
+++ b/test/range.cpp
@@ -38,7 +38,7 @@ class Range : public ::testing::Test
 };
 
 // create a list of types to be tested
-typedef ::testing::Types<float, double, int, unsigned int, unsigned char> TestTypes;
+typedef ::testing::Types<float, double, int, unsigned int, intl, uintl, unsigned char> TestTypes;
 
 // register the type list
 TYPED_TEST_CASE(Range, TestTypes);
diff --git a/test/scan.cpp b/test/scan.cpp
index 1a855ca..88ee8b4 100644
--- a/test/scan.cpp
+++ b/test/scan.cpp
@@ -103,9 +103,11 @@ vector<af_seq> init_subs()
 SCAN_TESTS(accum, float   , float     , float     );
 SCAN_TESTS(accum, double  , double    , double    );
 SCAN_TESTS(accum, int     , int       , int       );
-SCAN_TESTS(accum, cfloat  , cfloat , cfloat );
-SCAN_TESTS(accum, cdouble , cdouble, cdouble);
+SCAN_TESTS(accum, cfloat  , cfloat    , cfloat    );
+SCAN_TESTS(accum, cdouble , cdouble   , cdouble   );
 SCAN_TESTS(accum, unsigned, unsigned  , unsigned  );
+SCAN_TESTS(accum, intl    , intl      , intl      );
+SCAN_TESTS(accum, uintl   , uintl     , uintl     );
 SCAN_TESTS(accum, uchar   , unsigned char, unsigned);
 
 TEST(Scan,Test_Scan_Big0)
diff --git a/test/shift.cpp b/test/shift.cpp
index 1fe72ec..a3cf35d 100644
--- a/test/shift.cpp
+++ b/test/shift.cpp
@@ -38,7 +38,7 @@ class Shift : public ::testing::Test
 };
 
 // create a list of types to be tested
-typedef ::testing::Types<float, double, cfloat, cdouble, int, unsigned int, char, unsigned char> TestTypes;
+typedef ::testing::Types<float, double, cfloat, cdouble, int, unsigned int, intl, uintl, char, unsigned char> TestTypes;
 // register the type list
 TYPED_TEST_CASE(Shift, TestTypes);
 
diff --git a/test/tile.cpp b/test/tile.cpp
index fc38827..adeda5b 100644
--- a/test/tile.cpp
+++ b/test/tile.cpp
@@ -38,7 +38,7 @@ class Tile : public ::testing::Test
 };
 
 // create a list of types to be tested
-typedef ::testing::Types<float, double, cfloat, cdouble, int, unsigned int, char, unsigned char> TestTypes;
+typedef ::testing::Types<float, double, cfloat, cdouble, int, unsigned int, intl, uintl, char, unsigned char> TestTypes;
 
 // register the type list
 TYPED_TEST_CASE(Tile, TestTypes);

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