diff options
author | Eric Kunze <eric.kunze@arm.com> | 2021-10-25 16:13:22 -0700 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2021-10-28 09:57:55 -0700 |
commit | 82f19e2ad25bcbdde8e7f8b6bd6a6064a207fe36 (patch) | |
tree | c7a685d03bf2a9dd5a171b6c7409baf8c687da4f /chapters/comparison.adoc | |
parent | 3fe5256340778f586b80ac02b0632b54a39723f1 (diff) | |
download | specification-82f19e2ad25bcbdde8e7f8b6bd6a6064a207fe36.tar.gz |
Readability fixes for pseudocode
Avoid use of acc for variables when they are not convolution
accumulators.
Use argument types appropriately.
Add missing pseudocode for some MI operators
Change-Id: I9113f9228dbcafb85206bcc39310e9599cb12c08
Diffstat (limited to 'chapters/comparison.adoc')
-rw-r--r-- | chapters/comparison.adoc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/chapters/comparison.adoc b/chapters/comparison.adoc index 43f0787..ad574fb 100644 --- a/chapters/comparison.adoc +++ b/chapters/comparison.adoc @@ -1,7 +1,7 @@ // // This confidential and proprietary software may be used only as // authorised by a licensing agreement from ARM Limited -// (C) COPYRIGHT 2020 ARM Limited +// (C) COPYRIGHT 2020-2021 ARM Limited // ALL RIGHTS RESERVED // The entire notice above must be reproduced on all authorised // copies and copies may only be made to the extent permitted @@ -30,10 +30,10 @@ Elementwise comparison operation for_each(index in shape) { index1 = apply_broadcast(shape, shape1, index); index2 = apply_broadcast(shape, shape2, index); - int32_t value1 = tensor_read<in_t>(input1, shape1, index1); - int32_t value2 = tensor_read<in_t>(input2, shape2, index2); - bool_t acc = (value1 == value2) ? True : False; - tensor_write<out_t>(output, shape, index, acc); + in_t value1 = tensor_read<in_t>(input1, shape1, index1); + in_t value2 = tensor_read<in_t>(input2, shape2, index2); + out_t result = (value1 == value2) ? True : False; + tensor_write<out_t>(output, shape, index, result); } ---- @@ -67,10 +67,10 @@ Elementwise greater than comparison operation for_each(index in shape) { index1 = apply_broadcast(shape, shape1, index); index2 = apply_broadcast(shape, shape2, index); - int32_t value1 = tensor_read<in_t>(input1, shape1, index1); - int32_t value2 = tensor_read<in_t>(input2, shape2, index2); - bool_t acc = (value1 > value2) ? True : False; - tensor_write<out_t>(output, shape, index, acc); + in_t value1 = tensor_read<in_t>(input1, shape1, index1); + in_t value2 = tensor_read<in_t>(input2, shape2, index2); + out_t result = (value1 > value2) ? True : False; + tensor_write<out_t>(output, shape, index, result); } ---- @@ -103,10 +103,10 @@ Elementwise comparison operation for_each(index in shape) { index1 = apply_broadcast(shape, shape1, index); index2 = apply_broadcast(shape, shape2, index); - int32_t value1 = tensor_read<in_t>(input1, shape1, index1); - int32_t value2 = tensor_read<in_t>(input2, shape2, index2); - bool_t acc = (value1 >= value2) ? True : False; - tensor_write<out_t>(output, shape, index, acc); + in_t value1 = tensor_read<in_t>(input1, shape1, index1); + in_t value2 = tensor_read<in_t>(input2, shape2, index2); + out_t result = (value1 >= value2) ? True : False; + tensor_write<out_t>(output, shape, index, result); } ---- |