aboutsummaryrefslogtreecommitdiff
path: root/chapters/pseudocode.adoc
diff options
context:
space:
mode:
authorDominic Symes <dominic.symes@arm.com>2022-04-11 10:55:16 +0100
committerDominic Symes <dominic.symes@arm.com>2022-04-14 09:49:19 +0100
commita6ac716b995cbfe31a2549d41c6abb58f4fdce39 (patch)
treee2bd92dcdc46e18ccc03ec97854aba62f27352ad /chapters/pseudocode.adoc
parenta1ba656173cf49979f0139ebf91581a6ddd81c7a (diff)
downloadspecification-a6ac716b995cbfe31a2549d41c6abb58f4fdce39.tar.gz
Specify output dimension formulae for tensor ops
For each tensor op clarify how the output dimensions of output height (OH) and output width (OW) relate to the input height (IH) and input width (IW). Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: Iad36041f54e439c944cacf08afac5567dd2bad3f
Diffstat (limited to 'chapters/pseudocode.adoc')
-rw-r--r--chapters/pseudocode.adoc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chapters/pseudocode.adoc b/chapters/pseudocode.adoc
index 238aa33..3f885c7 100644
--- a/chapters/pseudocode.adoc
+++ b/chapters/pseudocode.adoc
@@ -185,6 +185,13 @@ int idiv(int input1, int input2) {
return input1 / input2; // Integer divide that truncates towards zero
}
+// Integer division that checks input1 is a multiple of input2
+
+int idiv_check(int input1, int input2) {
+ ERROR_IF(input1 % input2 != 0); // input1 must be a multiple of input2
+ return input1 / input2; // exact quotient without rounding
+}
+
int length(in_t input)
return number of elements in input list