From 61eefe0776295c1d8136ccd9b1b84b8736aad1ef Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 22 Mar 2023 13:58:54 -0400 Subject: [PATCH] Fix writing past end in i16 transpose with overlapped halves --- src/singeli/src/transpose.singeli | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/singeli/src/transpose.singeli b/src/singeli/src/transpose.singeli index c01a3329..33c4148e 100644 --- a/src/singeli/src/transpose.singeli +++ b/src/singeli/src/transpose.singeli @@ -85,6 +85,8 @@ fn transpose{T, k, kh}(r0:*void, x0:*void, w:u64, h:u64) : void = { # Effective height: number of rows read, counting overlap twice # Just use base transpose for short overhang; otherwise round up he := h; if (use_overlap{ho}) he += k - ho + def has_half = 2*k == kh + if (has_half and he==kh and hhm) y = hm @@ -92,12 +94,15 @@ fn transpose{T, k, kh}(r0:*void, x0:*void, w:u64, h:u64) : void = { kernel{...at{x,y}, k, kh, w, h} } } - # Half-row for non-square i16 case - if (2*k == kh and (he & k) != 0) { - e := h%kh; if (e