aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Petit <kevin.petit@arm.com>2024-02-08 11:03:29 +0000
committerKevin Petit <kevin.petit@arm.com>2024-02-23 18:33:47 +0000
commit0635552aed54eee35ca417901b65754a07a12dae (patch)
tree55cdac9a1bdb2edd1ad862ae8976698bdb7bbb3a
parentd2ca22c2af5e5a9c6c7279d0578c2b1f9620d5df (diff)
downloadspecification-0635552aed54eee35ca417901b65754a07a12dae.tar.gz
pseudocode: replace calls to non-existent functions
... with the correct libary functions. Change-Id: I99c252629d27be3977852a422774bc0be94922b3 Signed-off-by: Kevin Petit <kevin.petit@arm.com>
-rw-r--r--pseudocode/operators/CAST.tosac6
-rw-r--r--pseudocode/operators/MAX_POOL2D.tosac2
-rw-r--r--pseudocode/operators/REDUCE_MAX.tosac2
-rw-r--r--pseudocode/operators/REDUCE_MIN.tosac2
4 files changed, 6 insertions, 6 deletions
diff --git a/pseudocode/operators/CAST.tosac b/pseudocode/operators/CAST.tosac
index fd3ce72..4e2dca3 100644
--- a/pseudocode/operators/CAST.tosac
+++ b/pseudocode/operators/CAST.tosac
@@ -12,7 +12,7 @@ for_each(index in shape) {
out_t out;
if (out_t == bool_t) {
out = (in != 0) ? true : false;
- } else if (is_floating_point_type<out_t>()) {
+ } else if (is_floating_point<out_t>()) {
// Conversion to float cases
if (in_t == bool_t) {
out = (in) ? 1.0 : 0.0;
@@ -26,8 +26,8 @@ for_each(index in shape) {
// Conversion to integer cases
if (in_t == bool_t) {
out = (in) ? 1 : 0;
- } else if (is_floating_point_type<in_t>()) {
- out = truncate<out_t>(apply_clip_s<i32_t>(round_to_nearest_int(in), minimum<out_t>, maximum<out_t>));
+ } else if (is_floating_point<in_t>()) {
+ out = truncate<out_t>(apply_clip_s<i32_t>(round_to_nearest_int(in), minimum_s<out_t>(), maximum_s<out_t>()));
} else if (sizeof(out_t) >= sizeof(in_t)) {
out = sign_extend<out_t>(in);
} else {
diff --git a/pseudocode/operators/MAX_POOL2D.tosac b/pseudocode/operators/MAX_POOL2D.tosac
index eea5a70..3f0c4e0 100644
--- a/pseudocode/operators/MAX_POOL2D.tosac
+++ b/pseudocode/operators/MAX_POOL2D.tosac
@@ -18,7 +18,7 @@ ERROR_IF(OH != idiv_check(IH + pad_top + pad_bottom - kernel_y, stride_y) + 1);
ERROR_IF(OW != idiv_check(IW + pad_left + pad_right - kernel_x, stride_x) + 1);
for_each(0 <= n < N, 0 <= oy < OH, 0 <= ox < OW, 0 <= c < C ) {
- in_out_t acc = minimum_value<in_out_t>;
+ in_out_t acc = minimum_s<in_out_t>();
index_t iy = oy * stride_y - pad_top;
index_t ix = ox * stride_x - pad_left;
for_each( 0 <= ky < kernel_y, 0 <= kx < kernel_x ) {
diff --git a/pseudocode/operators/REDUCE_MAX.tosac b/pseudocode/operators/REDUCE_MAX.tosac
index 57f291a..40c8daf 100644
--- a/pseudocode/operators/REDUCE_MAX.tosac
+++ b/pseudocode/operators/REDUCE_MAX.tosac
@@ -13,7 +13,7 @@ left_shape = (axis > 1) ? shape[0:axis-1] : [];
right_shape = (axis < rank(shape)-1) ? shape[axis+1:rank(shape)-1] : [];
for_each(left_index in left_shape) {
for_each(right_index in right_shape) {
- in_out_t acc = minimum<in_out_t>;
+ in_out_t acc = minimum_s<in_out_t>();
for (i = 0; i < shape1[axis]; i++) {
index = flatten(left_index, [i], right_index);
in_out_t value = tensor_read<in_out_t>(input, shape1, index);
diff --git a/pseudocode/operators/REDUCE_MIN.tosac b/pseudocode/operators/REDUCE_MIN.tosac
index 437ecfd..e299fce 100644
--- a/pseudocode/operators/REDUCE_MIN.tosac
+++ b/pseudocode/operators/REDUCE_MIN.tosac
@@ -13,7 +13,7 @@ left_shape = (axis > 1) ? shape[0:axis-1] : [];
right_shape = (axis < rank(shape)-1) ? shape[axis+1:rank(shape)-1] : [];
for_each(left_index in left_shape) {
for_each(right_index in right_shape) {
- in_out_t acc = maximum<in_out_t>();
+ in_out_t acc = maximum_s<in_out_t>();
for (i = 0; i < shape1[axis]; i++) {
index = flatten(left_index, [i], right_index);
in_out_t value = tensor_read<in_out_t>(input, shape1, index);