diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-06-18 21:55:08 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-06-18 21:55:08 +0200 |
commit | c65320ad151cb5b92051866d17dcda49c7174e57 (patch) | |
tree | 104f4c69def294ebb7f2e5a1d49be166674fb8ab /cbits/arith.c | |
parent | 4a0b2ef27a6e31250c56faef0efc0abf611a0cda (diff) |
More sensible argument order to reduce1 C op
Diffstat (limited to 'cbits/arith.c')
-rw-r--r-- | cbits/arith.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cbits/arith.c b/cbits/arith.c index 4d60228..ea06ac1 100644 --- a/cbits/arith.c +++ b/cbits/arith.c @@ -164,7 +164,7 @@ static double log1pexp_double(double x) { LOG1PEXP_IMPL(x); } // Reduces along the innermost dimension. // 'out' will be filled densely in linearisation order. #define REDUCE1_OP(name, op, typ) \ - static void oxarop_op_ ## name ## _ ## typ(i64 rank, const i64 *shape, const i64 *strides, typ *out, const typ *arr) { \ + static void oxarop_op_ ## name ## _ ## typ(i64 rank, typ *out, const i64 *shape, const i64 *strides, const typ *arr) { \ TARRAY_WALK_NOINNER_CASE1(rank, shape, strides, { \ typ accum = arr[arrlinidx]; \ for (i64 i = 1; i < shape[rank - 1]; i++) { \ @@ -399,10 +399,10 @@ enum redop_tag_t { }; #define ENTRY_REDUCE1_OPS(typ) \ - void oxarop_reduce1_ ## typ(enum redop_tag_t tag, i64 rank, const i64 *shape, const i64 *strides, typ *out, const typ *arr) { \ + void oxarop_reduce1_ ## typ(enum redop_tag_t tag, i64 rank, typ *out, const i64 *shape, const i64 *strides, const typ *arr) { \ switch (tag) { \ - case RO_SUM: oxarop_op_sum1_ ## typ(rank, shape, strides, out, arr); break; \ - case RO_PRODUCT: oxarop_op_product1_ ## typ(rank, shape, strides, out, arr); break; \ + case RO_SUM: oxarop_op_sum1_ ## typ(rank, out, shape, strides, arr); break; \ + case RO_PRODUCT: oxarop_op_product1_ ## typ(rank, out, shape, strides, arr); break; \ default: wrong_op("reduce", tag); \ } \ } |