@@ -15,6 +15,24 @@ namespace af
1515{
1616 class array ;
1717
18+ // Add all the elements along a dimension
19+ AFAPI array sum (const array &in, const int dim = 0 );
20+
21+ // Get the minimum of all elements along a dimension
22+ AFAPI array min (const array &in, const int dim = 0 );
23+
24+ // Get the maximum of all elements along a dimension
25+ AFAPI array max (const array &in, const int dim = 0 );
26+
27+ // Check if all elements along a dimension are true
28+ AFAPI array alltrue (const array &in, const int dim = 0 );
29+
30+ // Check if any elements along a dimension are true
31+ AFAPI array anytrue (const array &in, const int dim = 0 );
32+
33+ // Count number of non zero elements along a dimension
34+ AFAPI array count (const array &in, const int dim = 0 );
35+
1836 AFAPI array diff1 (const array &in, const int dim = 0 );
1937
2038 AFAPI array diff2 (const array &in, const int dim = 0 );
@@ -42,6 +60,23 @@ namespace af
4260#ifdef __cplusplus
4361extern " C" {
4462#endif
63+ // Add all the elements along a dimension
64+ AFAPI af_err af_sum (af_array *out, const af_array in, const int dim);
65+
66+ // Get the minimum of all elements along a dimension
67+ AFAPI af_err af_min (af_array *out, const af_array in, const int dim);
68+
69+ // Get the maximum of all elements along a dimension
70+ AFAPI af_err af_max (af_array *out, const af_array in, const int dim);
71+
72+ // Check if all elements along a dimension are true
73+ AFAPI af_err af_alltrue (af_array *out, const af_array in, const int dim);
74+
75+ // Check if any elements along a dimension are true
76+ AFAPI af_err af_anytrue (af_array *out, const af_array in, const int dim);
77+
78+ // Count number of non zero elements along a dimension
79+ AFAPI af_err af_count (af_array *out, const af_array in, const int dim);
4580
4681 // Compute first order difference along a given dimension.
4782 AFAPI af_err af_diff1 (af_array *out, const af_array in, const int dim);
0 commit comments