From 0635552aed54eee35ca417901b65754a07a12dae Mon Sep 17 00:00:00 2001 From: Kevin Petit Date: Thu, 8 Feb 2024 11:03:29 +0000 Subject: pseudocode: replace calls to non-existent functions ... with the correct libary functions. Change-Id: I99c252629d27be3977852a422774bc0be94922b3 Signed-off-by: Kevin Petit --- pseudocode/operators/CAST.tosac | 6 +++--- pseudocode/operators/MAX_POOL2D.tosac | 2 +- pseudocode/operators/REDUCE_MAX.tosac | 2 +- pseudocode/operators/REDUCE_MIN.tosac | 2 +- 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()) { + } else if (is_floating_point()) { // 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()) { - out = truncate(apply_clip_s(round_to_nearest_int(in), minimum, maximum)); + } else if (is_floating_point()) { + out = truncate(apply_clip_s(round_to_nearest_int(in), minimum_s(), maximum_s())); } else if (sizeof(out_t) >= sizeof(in_t)) { out = sign_extend(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 acc = minimum_s(); 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 acc = minimum_s(); for (i = 0; i < shape1[axis]; i++) { index = flatten(left_index, [i], right_index); in_out_t value = tensor_read(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 acc = maximum_s(); for (i = 0; i < shape1[axis]; i++) { index = flatten(left_index, [i], right_index); in_out_t value = tensor_read(input, shape1, index); -- cgit v1.2.1