From d2f6d96cdc2ad2169c4abd0a8c4884f61ed6d186 Mon Sep 17 00:00:00 2001 From: Manuel Bottini Date: Wed, 15 Apr 2020 17:31:25 +0100 Subject: COMPMID-3378: CLScale failure Avoid creating tests for unsupported cases Change-Id: Ida0835af2f3d83c39544e930f8f5be3d4471fa38 Signed-off-by: Manuel Bottini Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3022 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Sang-Hoon Park --- tests/validation/fixtures/ScaleFixture.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/validation/fixtures/ScaleFixture.h b/tests/validation/fixtures/ScaleFixture.h index 8d851ce574..e3846eda67 100644 --- a/tests/validation/fixtures/ScaleFixture.h +++ b/tests/validation/fixtures/ScaleFixture.h @@ -70,6 +70,22 @@ public: scale_x = ((shape[idx_width] * scale_x) > max_width) ? (max_width / shape[idx_width]) : scale_x; scale_y = ((shape[idx_height] * scale_y) > max_height) ? (max_height / shape[idx_height]) : scale_y; + const bool align_corners_a = policy == InterpolationPolicy::BILINEAR + && sampling_policy == SamplingPolicy::TOP_LEFT + && align_corners; + + if(align_corners_a) + { + /* When align_corners = true is used for bilinear, both width and height + * of output should be > 1 to avoid overflow during computation otherwise + * it fails while checking argument values. + */ + constexpr float min_width = 2.f; + constexpr float min_height = 2.f; + scale_x = ((shape[idx_width] * scale_x) < min_width) ? (min_width / shape[idx_width]) : scale_x; + scale_y = ((shape[idx_height] * scale_y) < min_height) ? (min_height / shape[idx_height]) : scale_y; + } + std::uniform_int_distribution distribution_u8(0, 255); T constant_border_value = static_cast(distribution_u8(generator)); -- cgit v1.2.1