commit 398dc194b4299503dd2224df67fd2566b2379d41
parent 62a04de5537759f4a7323609e0541dd5649f4dde
Author: [email protected] <[email protected]>
Date: Mon, 19 Sep 2022 14:44:49 +0100
Fix read/write with stride
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/kfr/simd/read_write.hpp b/include/kfr/simd/read_write.hpp
@@ -97,7 +97,7 @@ KFR_INTRINSIC vec<T, Nout * groupsize> gather_stride(const T* base, size_t strid
constexpr size_t Nlow = prev_poweroftwo(Nout - 1);
return concat(
internal::gather_stride_s<Nlow, groupsize>(base, stride, csizeseq<Nlow>),
- internal::gather_stride_s<Nout - Nlow, groupsize>(base + Nlow, stride, csizeseq<Nout - Nlow>));
+ internal::gather_stride_s<Nout - Nlow, groupsize>(base + Nlow * stride, stride, csizeseq<Nout - Nlow>));
}
else
return internal::gather_stride_s<Nout, groupsize>(base, stride, csizeseq<Nout>);
@@ -152,7 +152,7 @@ KFR_INTRINSIC void scatter_stride(T* base, const vec<T, N>& value, size_t stride
{
constexpr size_t Nlow = prev_poweroftwo(Nout - 1);
internal::scatter_helper_s<groupsize>(base, stride, slice<0, Nlow>(value), csizeseq<Nlow>);
- internal::scatter_helper_s<groupsize>(base + Nlow, stride, slice<Nlow, Nout - Nlow>(value),
+ internal::scatter_helper_s<groupsize>(base + Nlow * stride, stride, slice<Nlow, Nout - Nlow>(value),
csizeseq<(Nout - Nlow)>);
}
else