aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominic Symes <dominic.symes@arm.com>2022-09-28 13:10:27 +0100
committerDominic Symes <dominic.symes@arm.com>2022-09-28 13:10:27 +0100
commitccde4d76185f2010d522d3a751a5dac586bdfca8 (patch)
tree42a9b52f0da4fcfd42d7d900b21243e401ca5ce4
parent5bb9a2a0ab667aac5517cf1fcbd725e2fa566938 (diff)
downloadspecification-ccde4d76185f2010d522d3a751a5dac586bdfca8.tar.gz
RESIZE: Clarify floating point types
Change resize_t to use the same type as in_t and out_t for floating point data. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I3214d92477688b95ba572f22d34aab3fef7d0f82
-rw-r--r--chapters/image.adoc10
-rw-r--r--tosa.xml4
2 files changed, 8 insertions, 6 deletions
diff --git a/chapters/image.adoc b/chapters/image.adoc
index 2c23e79..bcef73f 100644
--- a/chapters/image.adoc
+++ b/chapters/image.adoc
@@ -89,13 +89,15 @@ for_each(0 <= n < N, 0 <= oy < OH, 0 <= ox < OW; 0 <= c < C) {
int32_t x = ox * scale_x_d + offset_x;
int16_t iy = floor(y / scale_y_n);
int16_t ix = floor(x / scale_x_n);
+ int16_t ry = y - iy * scale_y_n; // (y % scale_y_n)
+ int16_t rx = x - ix * scale_x_n; // (x % scale_x_n)
if (is_floating_point(resize_t)) {
- dy = ((resize_t)y / (resize_t)scale_y_n) - iy;
- dx = ((resize_t)x / (resize_t)scale_x_n) - ix;
+ dy = (resize_t)ry / (resize_t)scale_y_n;
+ dx = (resize_t)rx / (resize_t)scale_x_n;
} else {
- dy = y - iy * scale_y_n;
- dx = y - ix * scale_x_n;
+ dy = ry;
+ dx = rx;
}
// Note that -1 <= iy < IH and -1 <= ix < IW
int16_t iy0 = apply_max(iy, 0);
diff --git a/tosa.xml b/tosa.xml
index bc86354..c17545b 100644
--- a/tosa.xml
+++ b/tosa.xml
@@ -1886,11 +1886,11 @@ used.</description>
<typesupport mode="signed 8, nearest" resize_t="int16_t" in_t="int8_t" out_t="int8_t"/>
<typesupport mode="signed 16, bilinear" resize_t="int16_t" in_t="int16_t" out_t="int48_t"/>
<typesupport mode="signed 16, nearest" resize_t="int16_t" in_t="int16_t" out_t="int16_t"/>
- <typesupport mode="fp16" resize_t="fp16_t" in_t="fp32_t" out_t="fp16_t">
+ <typesupport mode="fp16" resize_t="fp16_t" in_t="fp16_t" out_t="fp16_t">
<profile name="MI"/>
<profile name="MT"/>
</typesupport>
- <typesupport mode="bf16" resize_t="fp32_t" in_t="bf16_t" out_t="bf16_t">
+ <typesupport mode="bf16" resize_t="bf16_t" in_t="bf16_t" out_t="bf16_t">
<profile name="MI"/>
<profile name="MT"/>
</typesupport>