diff options
| author | Tom Smeding <tom@tomsmeding.com> | 2025-03-05 22:39:01 +0100 | 
|---|---|---|
| committer | Tom Smeding <tom@tomsmeding.com> | 2025-03-05 22:39:01 +0100 | 
| commit | eff6b7ba64fbe4e6e260ce3266109fd9fee27ae2 (patch) | |
| tree | 429c4873cc9d338a37d4272994061363367f48f4 | |
| parent | 984e5315768dd190a97069167daf970c17c3c867 (diff) | |
C: Simplify DOTPROD_STRIDED_OP signature
| -rw-r--r-- | cbits/arith.c | 6 | 
1 files changed, 3 insertions, 3 deletions
| 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); \        }); \      } \    } | 
