diff options
author | Abe Mbise <abe.mbise@arm.com> | 2017-09-19 16:19:13 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | 31bbce1249138633ecd34d351e2ea237ff6d55c8 (patch) | |
tree | e30fdbf5d2c0b8056cbcc6631b7c460b8cd03bda /tests/validation/CPP/Utils.cpp | |
parent | 83be745adba7a9928c03beda65a6a83f14846475 (diff) | |
download | ComputeLibrary-31bbce1249138633ecd34d351e2ea237ff6d55c8.tar.gz |
COMPMID-510: Port Warp Perspective to new validation
Change-Id: I0d96ceb9d9d1d077bec09330cda4fbe6d81ce641
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/88476
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'tests/validation/CPP/Utils.cpp')
-rw-r--r-- | tests/validation/CPP/Utils.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
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 <typename T> T bilinear_policy(const SimpleTensor<T> &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 |