aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Petit <kevin.petit@arm.com>2024-01-16 21:40:08 +0000
committerKevin Petit <kevin.petit@arm.com>2024-01-16 21:40:32 +0000
commit1c16f5447886826cd86d0fe2893dcd193c42dcec (patch)
treeaa0c335dc3d09684d5d98a27b5d20a8ef343ff89
parenta7ac313a13f8f82b4b3ca9730bd746392f6600d9 (diff)
downloadspecification-1c16f5447886826cd86d0fe2893dcd193c42dcec.tar.gz
pseudocode: a collection of trivial fixes
- Add missing parenthesis in ARITHMETIC_SHIFT_RIGHT - Add missing semicolons - Remove stray dot in VARIABLE_WRITE Change-Id: I28ab7c80c735995437588fffeffb1f12d112f3ec Signed-off-by: Kevin Petit <kevin.petit@arm.com>
-rw-r--r--pseudocode/operators/ARITHMETIC_RIGHT_SHIFT.tosac2
-rw-r--r--pseudocode/operators/CAST.tosac2
-rw-r--r--pseudocode/operators/NEGATE.tosac4
-rw-r--r--pseudocode/operators/TRANSPOSE.tosac4
-rw-r--r--pseudocode/operators/TRANSPOSE_CONV2D.tosac2
-rw-r--r--pseudocode/operators/VARIABLE_WRITE.tosac2
6 files changed, 8 insertions, 8 deletions
diff --git a/pseudocode/operators/ARITHMETIC_RIGHT_SHIFT.tosac b/pseudocode/operators/ARITHMETIC_RIGHT_SHIFT.tosac
index 4077146..7ed4886 100644
--- a/pseudocode/operators/ARITHMETIC_RIGHT_SHIFT.tosac
+++ b/pseudocode/operators/ARITHMETIC_RIGHT_SHIFT.tosac
@@ -21,7 +21,7 @@ for_each(index in shape) {
in_out_t result = apply_arith_rshift<in_out_t>(value1, value2);
if (round == true && static_cast<int32_t>(value2) > 0 &&
- (apply_arith_rshift<in_out_t>(value1, apply_sub_s<in_out_t>(value2, 1)) & 1 != 0) {
+ (apply_arith_rshift<in_out_t>(value1, apply_sub_s<in_out_t>(value2, 1)) & 1 != 0)) {
result = result + 1;
}
result = apply_clip_s<in_out_t>(result, minimum_s<in_out_t>, maximum_s<in_out_t>);
diff --git a/pseudocode/operators/CAST.tosac b/pseudocode/operators/CAST.tosac
index f6306b3..8d816ca 100644
--- a/pseudocode/operators/CAST.tosac
+++ b/pseudocode/operators/CAST.tosac
@@ -23,5 +23,5 @@ for_each(index in shape) {
} else {
out = truncate(in);
}
- tensor_write<out_t>(output, shape, index, out)
+ tensor_write<out_t>(output, shape, index, out);
}
diff --git a/pseudocode/operators/NEGATE.tosac b/pseudocode/operators/NEGATE.tosac
index 8c235f1..cae57f3 100644
--- a/pseudocode/operators/NEGATE.tosac
+++ b/pseudocode/operators/NEGATE.tosac
@@ -7,8 +7,8 @@
// copies and copies may only be made to the extent permitted
// by a licensing agreement from ARM Limited.
-ERROR_IF(in_out_t != i8_t && input1_zp != 0) // Zero point only for int8_t
-ERROR_IF(in_out_t != i8_t && output_zp != 0) // Zero point only for int8_t
+ERROR_IF(in_out_t != i8_t && input1_zp != 0); // Zero point only for int8_t
+ERROR_IF(in_out_t != i8_t && output_zp != 0); // Zero point only for int8_t
for_each(index in shape) {
in_out_t value1 = tensor_read<in_out_t>(input1, shape, index);
acc_t value = apply_sub_s<acc_t>(sign_extend<acc_t>(value1),
diff --git a/pseudocode/operators/TRANSPOSE.tosac b/pseudocode/operators/TRANSPOSE.tosac
index a8f0815..e75db79 100644
--- a/pseudocode/operators/TRANSPOSE.tosac
+++ b/pseudocode/operators/TRANSPOSE.tosac
@@ -22,13 +22,13 @@ for_each(index in perms) {
// Ensure that the output shapes have the properly
// permuted shapes
for(i = 0; i < rank(shape); i++) {
- ERROR_IF(shape1[perms[i]] != shape[i])
+ ERROR_IF(shape1[perms[i]] != shape[i]);
}
for_each(index in shape) {
dim_t tmp_index = index;
for(i = 0; i < rank(shape); i++) {
- tmp_index[perms[i]] = index[i]
+ tmp_index[perms[i]] = index[i];
}
in_out_t value = tensor_read<in_out_t>(input1, shape1, tmp_index);
tensor_write<in_out_t>(output, shape, index, value);
diff --git a/pseudocode/operators/TRANSPOSE_CONV2D.tosac b/pseudocode/operators/TRANSPOSE_CONV2D.tosac
index 3aa0e23..ab61348 100644
--- a/pseudocode/operators/TRANSPOSE_CONV2D.tosac
+++ b/pseudocode/operators/TRANSPOSE_CONV2D.tosac
@@ -17,7 +17,7 @@ ERROR_IF(OW != (IW - 1) * stride_x + out_pad_left + out_pad_right + KW);
ERROR_IF(BC != OC && BC != 1);
for_each(index in [N, OH, OW, OC]) {
- tensor_write<out_t>(output, [N,OH,OW,OC], index, bias[(BC == 1) ? 0 : index[3]])
+ tensor_write<out_t>(output, [N,OH,OW,OC], index, bias[(BC == 1) ? 0 : index[3]]);
}
for_each(0 <= n < N, 0 <= iy < IH, 0 <= ix < IW, 0 <= oc < OC,
0 <= ic < IC, 0 <= ky < KH, 0 <= kx < KW) {
diff --git a/pseudocode/operators/VARIABLE_WRITE.tosac b/pseudocode/operators/VARIABLE_WRITE.tosac
index 83c5525..245fff5 100644
--- a/pseudocode/operators/VARIABLE_WRITE.tosac
+++ b/pseudocode/operators/VARIABLE_WRITE.tosac
@@ -8,7 +8,7 @@
// by a licensing agreement from ARM Limited.
-tensor_t. variable_tensor = variable_tensor_lookup(uid);
+tensor_t variable_tensor = variable_tensor_lookup(uid);
// Check this variable tensor has been declared
REQUIRE(variable_tensor);
// The tensor has to be seen before to be written to