From 31bbce1249138633ecd34d351e2ea237ff6d55c8 Mon Sep 17 00:00:00 2001 From: Abe Mbise Date: Tue, 19 Sep 2017 16:19:13 +0100 Subject: COMPMID-510: Port Warp Perspective to new validation Change-Id: I0d96ceb9d9d1d077bec09330cda4fbe6d81ce641 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/88476 Tested-by: Kaizen Reviewed-by: Pablo Tello --- tests/validation/CPP/Utils.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tests/validation/CPP/Utils.cpp') diff --git a/tests/validation/CPP/Utils.cpp b/tests/validation/CPP/Utils.cpp index af3ed9099f..d163e8436f 100644 --- a/tests/validation/CPP/Utils.cpp +++ b/tests/validation/CPP/Utils.cpp @@ -35,8 +35,8 @@ namespace validation template T bilinear_policy(const SimpleTensor &in, Coordinates id, float xn, float yn, BorderMode border_mode, T constant_border_value) { - int idx = std::floor(xn); - int idy = std::floor(yn); + const int idx = std::floor(xn); + const int idy = std::floor(yn); const float dx = xn - idx; const float dy = yn - idy; @@ -94,6 +94,19 @@ RawTensor transpose(const RawTensor &src, int chunk_width) return dst; } + +bool valid_bilinear_policy(float xn, float yn, int width, int height, BorderMode border_mode) +{ + if(border_mode != BorderMode::UNDEFINED) + { + return true; + } + if((0 <= yn + 1) && (yn + 1 < height) && (0 <= xn + 1) && (xn + 1 < width)) + { + return true; + } + return false; +} } // namespace validation } // namespace test } // namespace arm_compute -- cgit v1.2.1