diff options
author | Eric Kunze <eric.kunze@arm.com> | 2021-02-17 19:23:39 -0800 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2021-03-08 10:06:31 -0800 |
commit | 1e9ba65f263a15f1f9cf9b9484047ea51237187a (patch) | |
tree | bf1eb0f43d24b207612e6e8a87799a211ba155a4 /chapters/comparison.adoc | |
parent | 54ff87d31637c97958ac49e40312e9b6de0a8f1a (diff) | |
download | specification-1e9ba65f263a15f1f9cf9b9484047ea51237187a.tar.gz |
Consistency cleanup
Attempt to get consistent across the pseudocode.
Change the data types to all be intN_t instead of some cases of intN.
Use float_t as the general floating point data type.
Be consistent on use of the term "floating-point"
Move general pseudocode helpers to their own section.
Change-Id: Ie77666cd3ee438c71f39c62b9c424fe687b0bb51
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Diffstat (limited to 'chapters/comparison.adoc')
-rw-r--r-- | chapters/comparison.adoc | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/chapters/comparison.adoc b/chapters/comparison.adoc index f9439fc..289196f 100644 --- a/chapters/comparison.adoc +++ b/chapters/comparison.adoc @@ -27,13 +27,13 @@ Elementwise comparison operation [source,c] ---- -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) +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); } ---- @@ -42,8 +42,8 @@ for_each (index in shape) { |=== |Profile|Mode|in_t|out_t -|Any|signed 32|int32|bool -|MI, MT|float|float|bool +|Any|signed 32|int32_t|bool_t +|MI, MT|floating-point|float_t|bool_t |=== ==== GREATER @@ -63,13 +63,13 @@ Elementwise greater than comparison operation [source,c] ---- -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) +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); } ---- @@ -77,8 +77,8 @@ for_each (index in shape) { |=== |Profile|Mode|in_t|out_t -|Any|signed 32|int32|bool -|MI, MT|float|float|bool +|Any|signed 32|int32_t|bool_t +|MI, MT|floating-point|float_t|bool_t |=== ==== GREATER_EQUAL @@ -99,13 +99,13 @@ Elementwise comparison operation [source,c] ---- -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) +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); } ---- @@ -114,6 +114,6 @@ for_each (index in shape) { |=== |Profile|Mode|in_t|out_t -|Any|signed 32|int32|bool -|MI, MT|float|float|bool +|Any|signed 32|int32_t|bool_t +|MI, MT|floating-point|float_t|bool_t |=== |