aboutsummaryrefslogtreecommitdiff
path: root/cbits
diff options
context:
space:
mode:
Diffstat (limited to 'cbits')
-rw-r--r--cbits/arith.c6
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); \
}); \
} \
}