diff options
author | Diego Lopez Recas <Diego.LopezRecas@arm.com> | 2017-12-04 18:56:10 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:45:00 +0000 |
commit | 35ceeb2199c569810a1524a0a21c2df2a3f5f29e (patch) | |
tree | 4a55f8626cb2960843547fabdb2431a70ec1029a /src/core/IAccessWindow.cpp | |
parent | 97cf2497d2b617de3209330893ad51bd0cc126ce (diff) | |
download | ComputeLibrary-35ceeb2199c569810a1524a0a21c2df2a3f5f29e.tar.gz |
IVGCVSW-798 Add Softmax NEON support for QASYMM8
Change-Id: I4f2cca52caf210fdb7d6bb7e9436ac51cb5088b4
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/112398
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/IAccessWindow.cpp')
-rw-r--r-- | src/core/IAccessWindow.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/core/IAccessWindow.cpp b/src/core/IAccessWindow.cpp index 693d851a5d..7dfe5db5c5 100644 --- a/src/core/IAccessWindow.cpp +++ b/src/core/IAccessWindow.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -122,9 +122,10 @@ bool AccessWindowRectangle::update_window_if_needed(Window &window) const if(min_y < front_pad_y_available) { // Not enough padding available, need to shrink the window - const int start = adjust_up(min_y, front_pad_y_available, window.y().step() * _scale_y) - _y; + int start = adjust_up(min_y, front_pad_y_available, window.y().step() * _scale_y) - _y; + start = std::min<int>(start / _scale_y, window.y().end()); - window.set(1, Window::Dimension(start / _scale_y, window.y().end(), window.y().step())); + window.set(1, Window::Dimension(start, window.y().end(), window.y().step())); window_modified = true; } @@ -143,8 +144,10 @@ bool AccessWindowRectangle::update_window_if_needed(Window &window) const if(static_cast<int>(shape[1]) + tail_pad_y_available < max_y) { // Not enough padding available, need to shrink the window - const int end = adjust_down(max_y, shape[1] + tail_pad_y_available, window.y().step() * _scale_y) + window.y().step() * _scale_y - _y - _height; - window.set(1, Window::Dimension(window.y().start(), end / _scale_y, window.y().step())); + int end = adjust_down(max_y, shape[1] + tail_pad_y_available, window.y().step() * _scale_y) + window.y().step() * _scale_y - _y - _height; + end = std::max<int>(window.y().start(), end / _scale_y); + + window.set(1, Window::Dimension(window.y().start(), end, window.y().step())); window_modified = true; } } @@ -164,8 +167,10 @@ bool AccessWindowRectangle::update_window_if_needed(Window &window) const if(min_x < front_pad_x_available) { // Not enough padding available, need to shrink the window - const int start = adjust_up(min_x, front_pad_x_available, window.x().step() * _scale_x) - _x; - window.set(0, Window::Dimension(start / _scale_x, window.x().end(), window.x().step())); + int start = adjust_up(min_x, front_pad_x_available, window.x().step() * _scale_x) - _x; + start = std::min<int>(start / _scale_x, window.x().end()); + + window.set(0, Window::Dimension(start, window.x().end(), window.x().step())); window_modified = true; } @@ -181,8 +186,10 @@ bool AccessWindowRectangle::update_window_if_needed(Window &window) const if(static_cast<int>(shape[0]) + tail_pad_x_available < max_x) { // Not enough padding available, need to shrink the window - const int end = adjust_down(max_x, shape[0] + tail_pad_x_available, window.x().step() * _scale_x) + window.x().step() * _scale_x - _x - _width; - window.set(0, Window::Dimension(window.x().start(), end / _scale_x, window.x().step())); + int end = adjust_down(max_x, shape[0] + tail_pad_x_available, window.x().step() * _scale_x) + window.x().step() * _scale_x - _x - _width; + end = std::max<int>(window.x().start(), end / _scale_x); + + window.set(0, Window::Dimension(window.x().start(), end, window.x().step())); window_modified = true; } } @@ -192,7 +199,7 @@ bool AccessWindowRectangle::update_window_if_needed(Window &window) const return window_modified; } -bool AccessWindowRectangle::update_padding_if_needed(const Window &window) const +bool AccessWindowRectangle::update_padding_if_needed(const Window &window) { // Only update the padding if the tensor allows it if(_info == nullptr || !_info->is_resizable()) |