From eff6b7ba64fbe4e6e260ce3266109fd9fee27ae2 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 5 Mar 2025 22:39:01 +0100 Subject: C: Simplify DOTPROD_STRIDED_OP signature --- cbits/arith.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cbits/arith.c') diff --git a/cbits/arith.c b/cbits/arith.c index 8d0700d..2788e41 100644 --- a/cbits/arith.c +++ b/cbits/arith.c @@ -279,9 +279,9 @@ static void print_shape(FILE *stream, i64 rank, const i64 *shape) { } #define DOTPROD_STRIDED_OP(typ) \ - typ oxarop_dotprod_ ## typ ## _strided(i64 length, i64 offset1, i64 stride1, const typ *arr1, i64 offset2, i64 stride2, const typ *arr2) { \ + typ oxarop_dotprod_ ## typ ## _strided(i64 length, i64 stride1, const typ *arr1, i64 stride2, const typ *arr2) { \ typ res = 0; \ - for (i64 i = 0; i < length; i++) res += arr1[offset1 + stride1 * i] * arr2[offset2 + stride2 * i]; \ + for (i64 i = 0; i < length; i++) res += arr1[stride1 * i] * arr2[stride2 * i]; \ return res; \ } @@ -336,7 +336,7 @@ DOTPROD_OP(double) }); \ } else { \ TARRAY_WALK2_NOINNER(again3, rank, shape, strides1, strides2, { \ - out[outlinidx] = oxarop_dotprod_ ## typ ## _strided(shape[rank - 1], arrlinidx1, strides1[rank - 1], arr1, arrlinidx2, strides2[rank - 1], arr2); \ + out[outlinidx] = oxarop_dotprod_ ## typ ## _strided(shape[rank - 1], strides1[rank - 1], arr1 + arrlinidx1, strides2[rank - 1], arr2 + arrlinidx2); \ }); \ } \ } -- cgit v1.2.3-70-g09d2