diff options
author | Manuel Bottini <manuel.bottini@arm.com> | 2020-04-15 17:31:25 +0100 |
---|---|---|
committer | Manuel Bottini <manuel.bottini@arm.com> | 2020-04-17 09:17:52 +0000 |
commit | d2f6d96cdc2ad2169c4abd0a8c4884f61ed6d186 (patch) | |
tree | 646bd3a2590b9337d26e29e0e1d78740fece2ad7 /tests/validation | |
parent | b7f4a95c4bf27b4507e5b3b9278c249b1feefe36 (diff) | |
download | ComputeLibrary-d2f6d96cdc2ad2169c4abd0a8c4884f61ed6d186.tar.gz |
COMPMID-3378: CLScale failure
Avoid creating tests for unsupported cases
Change-Id: Ida0835af2f3d83c39544e930f8f5be3d4471fa38
Signed-off-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3022
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Sang-Hoon Park <sang-hoon.park@arm.com>
Diffstat (limited to 'tests/validation')
-rw-r--r-- | tests/validation/fixtures/ScaleFixture.h | 16 |
1 files changed, 16 insertions, 0 deletions
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<uint8_t> distribution_u8(0, 255); T constant_border_value = static_cast<T>(distribution_u8(generator)); |