[arrayfire] 14/248: Heterogeneous API for arith and algorithm header functions

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Nov 17 15:53:49 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 131de34fe4c9a81b4384c79deb91def11f2f1015
Author: pradeep <pradeep at arrayfire.com>
Date:   Wed Aug 26 15:08:29 2015 -0400

    Heterogeneous API for arith and algorithm header functions
---
 src/api/hapi/algorithm.cpp | 135 +++++++++++++++++++++++++++++++++++++++++++++
 src/api/hapi/arith.cpp     |  43 +++++++++++++++
 2 files changed, 178 insertions(+)

diff --git a/src/api/hapi/algorithm.cpp b/src/api/hapi/algorithm.cpp
new file mode 100644
index 0000000..ee96b31
--- /dev/null
+++ b/src/api/hapi/algorithm.cpp
@@ -0,0 +1,135 @@
+/*******************************************************
+ * Copyright (c) 2014, ArrayFire
+ * All rights reserved.
+ *
+ * This file is distributed under 3-clause BSD license.
+ * The complete license agreement can be obtained at:
+ * http://arrayfire.com/licenses/BSD-3-Clause
+ ********************************************************/
+
+#include <af/array.h>
+#include <af/algorithm.h>
+#include "symbol_manager.hpp"
+
+#define ALGO_HAPI_DEF(af_func) \
+af_err af_func(af_array* out, const af_array in, const int dim) \
+{ \
+    return CALL(out, in, dim); \
+}
+
+ALGO_HAPI_DEF(af_sum)
+ALGO_HAPI_DEF(af_product)
+ALGO_HAPI_DEF(af_min)
+ALGO_HAPI_DEF(af_max)
+ALGO_HAPI_DEF(af_all_true)
+ALGO_HAPI_DEF(af_any_true)
+ALGO_HAPI_DEF(af_count)
+ALGO_HAPI_DEF(af_accum)
+ALGO_HAPI_DEF(af_diff1)
+ALGO_HAPI_DEF(af_diff2)
+
+#undef ALGO_HAPI_DEF
+
+#define ALGO_HAPI_DEF(af_func_nan) \
+af_err af_func_nan(af_array* out, const af_array in, const int dim, const double nanval) \
+{ \
+    return CALL(out, in, dim, nanval); \
+}
+
+ALGO_HAPI_DEF(af_sum_nan)
+ALGO_HAPI_DEF(af_product_nan)
+
+#undef ALGO_HAPI_DEF
+
+#define ALGO_HAPI_DEF(af_func_all) \
+af_err af_func_all(double *real, double *imag, const af_array in) \
+{ \
+    return CALL(real, imag, in);\
+}
+
+ALGO_HAPI_DEF(af_sum_all)
+ALGO_HAPI_DEF(af_product_all)
+ALGO_HAPI_DEF(af_min_all)
+ALGO_HAPI_DEF(af_max_all)
+ALGO_HAPI_DEF(af_all_true_all)
+ALGO_HAPI_DEF(af_any_true_all)
+ALGO_HAPI_DEF(af_count_all)
+
+#undef ALGO_HAPI_DEF
+
+#define ALGO_HAPI_DEF(af_func_nan_all) \
+af_err af_func_nan_all(double *real, double *imag, const af_array in, const double nanval) \
+{ \
+    return CALL(real, imag, in, nanval);\
+}
+
+ALGO_HAPI_DEF(af_sum_nan_all)
+ALGO_HAPI_DEF(af_product_nan_all)
+
+#undef ALGO_HAPI_DEF
+
+
+#define ALGO_HAPI_DEF(af_ifunc) \
+af_err af_ifunc(af_array* out, af_array *idx, const af_array in, const int dim) \
+{ \
+    return CALL(out, idx, in, dim); \
+}
+
+ALGO_HAPI_DEF(af_imin)
+ALGO_HAPI_DEF(af_imax)
+
+#undef ALGO_HAPI_DEF
+
+#define ALGO_HAPI_DEF(af_ifunc_all) \
+af_err af_ifunc_all(double *real, double *imag, unsigned *idx, const af_array in) \
+{ \
+    return CALL(real, imag, idx, in);\
+}
+
+ALGO_HAPI_DEF(af_imin_all)
+ALGO_HAPI_DEF(af_imax_all)
+
+#undef ALGO_HAPI_DEF
+
+
+af_err af_where(af_array *idx, const af_array in)
+{
+    return CALL(idx, in);
+}
+
+af_err af_sort(af_array *out, const af_array in, const unsigned dim, const bool isAscending)
+{
+    return CALL(out, in, dim, isAscending);
+}
+
+af_err af_sort_index(af_array *out, af_array *indices, const af_array in,
+                     const unsigned dim, const bool isAscending)
+{
+    return CALL(out, indices, in, dim, isAscending);
+}
+
+af_err af_sort_by_key(af_array *out_keys, af_array *out_values,
+                      const af_array keys, const af_array values,
+                      const unsigned dim, const bool isAscending)
+{
+    return CALL(out_keys, out_values, keys, values, dim, isAscending);
+}
+
+af_err af_set_unique(af_array *out, const af_array in, const bool is_sorted)
+{
+    return CALL(out, in, is_sorted);
+}
+
+af_err af_set_union(af_array *out,
+                    const af_array first, const af_array second,
+                    const bool is_unique)
+{
+    return CALL(out, first, second, is_unique);
+}
+
+af_err af_set_intersect(af_array *out,
+                        const af_array first, const af_array second,
+                        const bool is_unique)
+{
+    return CALL(out, first, second, is_unique);
+}
diff --git a/src/api/hapi/arith.cpp b/src/api/hapi/arith.cpp
new file mode 100644
index 0000000..27c6bfc
--- /dev/null
+++ b/src/api/hapi/arith.cpp
@@ -0,0 +1,43 @@
+/*******************************************************
+ * Copyright (c) 2014, ArrayFire
+ * All rights reserved.
+ *
+ * This file is distributed under 3-clause BSD license.
+ * The complete license agreement can be obtained at:
+ * http://arrayfire.com/licenses/BSD-3-Clause
+ ********************************************************/
+
+#include <af/array.h>
+#include <af/arith.h>
+#include "symbol_manager.hpp"
+
+#define BINARY_HAPI_DEF(af_func) \
+af_err af_func(af_array* out, const af_array lhs, const af_array rhs, const bool batchMode) \
+{ \
+    return CALL(out, lhs, rhs, batchMode); \
+}
+
+BINARY_HAPI_DEF(af_add)
+BINARY_HAPI_DEF(af_mul)
+BINARY_HAPI_DEF(af_sub)
+BINARY_HAPI_DEF(af_div)
+BINARY_HAPI_DEF(af_maxof)
+BINARY_HAPI_DEF(af_minof)
+BINARY_HAPI_DEF(af_rem)
+BINARY_HAPI_DEF(af_mod)
+BINARY_HAPI_DEF(af_pow)
+BINARY_HAPI_DEF(af_root)
+BINARY_HAPI_DEF(af_atan2)
+BINARY_HAPI_DEF(af_eq)
+BINARY_HAPI_DEF(af_neq)
+BINARY_HAPI_DEF(af_gt)
+BINARY_HAPI_DEF(af_ge)
+BINARY_HAPI_DEF(af_lt)
+BINARY_HAPI_DEF(af_le)
+BINARY_HAPI_DEF(af_and)
+BINARY_HAPI_DEF(af_or)
+BINARY_HAPI_DEF(af_bitand)
+BINARY_HAPI_DEF(af_bitor)
+BINARY_HAPI_DEF(af_bitxor)
+BINARY_HAPI_DEF(af_bitshiftl)
+BINARY_HAPI_DEF(af_bitshiftr)

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