aboutsummaryrefslogtreecommitdiff
path: root/chapters/ewise_ternary.adoc
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2021-02-17 19:23:39 -0800
committerEric Kunze <eric.kunze@arm.com>2021-03-08 10:06:31 -0800
commit1e9ba65f263a15f1f9cf9b9484047ea51237187a (patch)
treebf1eb0f43d24b207612e6e8a87799a211ba155a4 /chapters/ewise_ternary.adoc
parent54ff87d31637c97958ac49e40312e9b6de0a8f1a (diff)
downloadspecification-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/ewise_ternary.adoc')
-rw-r--r--chapters/ewise_ternary.adoc34
1 files changed, 17 insertions, 17 deletions
diff --git a/chapters/ewise_ternary.adoc b/chapters/ewise_ternary.adoc
index 17e966c..4d20316 100644
--- a/chapters/ewise_ternary.adoc
+++ b/chapters/ewise_ternary.adoc
@@ -32,20 +32,20 @@ None
[source,c]
----
-for_each (index in shape) {
- index1 = apply_broadcast(shape, shape1, index)
- index2 = apply_broadcast(shape, shape2, index)
- index3 = apply_broadcast(shape, shpae3, index)
- bool_t value1 = tensor_read<in_t>(input1, shape1, index1)
- in_t value2 = tensor_read<in_t>(input2, shape2, index2)
- in_t value3 = tensor_read<in_t>(input3, shape3, index3)
- in_t acc = 0
- if (value1 == True){
- acc = value2
+for_each(index in shape) {
+ index1 = apply_broadcast(shape, shape1, index);
+ index2 = apply_broadcast(shape, shape2, index);
+ index3 = apply_broadcast(shape, shpae3, index);
+ bool_t value1 = tensor_read<in_t>(input1, shape1, index1);
+ in_t value2 = tensor_read<in_t>(input2, shape2, index2);
+ in_t value3 = tensor_read<in_t>(input3, shape3, index3);
+ in_t acc = 0;
+ if (value1 == True) {
+ acc = value2;
} else {
- acc = value3
+ acc = value3;
}
- tensor_write<in_t>(output, shape, index, acc)
+ tensor_write<in_t>(output, shape, index, acc);
}
----
@@ -53,9 +53,9 @@ for_each (index in shape) {
|===
|Profile|Mode|bool_t|in_t
-|Any|Boolean|bool|bool
-|Any|signed 8|bool|int8
-|Any|signed 16|bool|int16
-|Any|signed 32|bool|int32
-|MI, MT|float|bool|float
+|Any|Boolean|bool_t|bool_t
+|Any|signed 8|bool_t|int8_t
+|Any|signed 16|bool_t|int16_t
+|Any|signed 32|bool_t|int32_t
+|MI, MT|floating-point|bool_t|float_t
|===