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/control_flow.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/control_flow.adoc')
-rw-r--r-- | chapters/control_flow.adoc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/chapters/control_flow.adoc b/chapters/control_flow.adoc index b5e305d..31bdf3c 100644 --- a/chapters/control_flow.adoc +++ b/chapters/control_flow.adoc @@ -37,9 +37,9 @@ assert(tensor_list_shape(output_list)==tosa_output_shape(then_graph)); assert(tensor_list_shape(output_list)==tosa_output_shape(else_graph)); if (condition) { - tosa_execute_graph(then_graph, input_list, output_list) + tosa_execute_graph(then_graph, input_list, output_list); } else { - tosa_execute_graph(else_graph, input_list, output_list) + tosa_execute_graph(else_graph, input_list, output_list); } ---- @@ -70,13 +70,13 @@ assert(tosa_output_shape(cond_graph)==tosa_list_shape([bool_t])); // The iteration number 'i' is included to give unique names to variables // in each iteration of the loop and is not required by implementations -int i=0 // iteration number -list[i] = input_list // copy input data as list[0] -tosa_execute_graph(cond_graph, list[i], [condition[i]]) // initial condition +int i=0; // iteration number +list[i] = input_list; // copy input data as list[0] +tosa_execute_graph(cond_graph, list[i], [condition[i]]); // initial condition while (condition[i]) { - tosa_execute_graph(body_graph, list[i], list[i+1]) - i = i+1 - tosa_execute_graph(cond_graph, list[i], [condition[i]]) + tosa_execute_graph(body_graph, list[i], list[i+1]); + i = i+1; + tosa_execute_graph(cond_graph, list[i], [condition[i]]); } -output_list = list[i] +output_list = list[i]; ---- |