diff options
author | Pablo Tello <pablo.tello@arm.com> | 2018-01-23 09:36:04 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:45:00 +0000 |
commit | d6ca478a7e410f8f529c2e505305b46d9fe21a9b (patch) | |
tree | 5c50c06e07f812890f127b1c4933996987f74f17 /arm_compute/core/NEON/kernels/winograd/transforms | |
parent | d05dce46a14a7b67f322328ecd95bf96bdd30bae (diff) | |
download | ComputeLibrary-d6ca478a7e410f8f529c2e505305b46d9fe21a9b.tar.gz |
COMPMID-784: Added support for biases in WinogradLayer.
1) Updated to the latest code from the RSH repo.
2) Moved winograd transforms into kernels.
3) Added support for biases
Change-Id: I7f39f34a599b49d7d9b549cc10a4f4d4a8007ab8
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/117474
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'arm_compute/core/NEON/kernels/winograd/transforms')
-rw-r--r-- | arm_compute/core/NEON/kernels/winograd/transforms/input.hpp | 2 | ||||
-rw-r--r-- | arm_compute/core/NEON/kernels/winograd/transforms/output.hpp | 21 |
2 files changed, 15 insertions, 8 deletions
diff --git a/arm_compute/core/NEON/kernels/winograd/transforms/input.hpp b/arm_compute/core/NEON/kernels/winograd/transforms/input.hpp index 39b444184e..075765a513 100644 --- a/arm_compute/core/NEON/kernels/winograd/transforms/input.hpp +++ b/arm_compute/core/NEON/kernels/winograd/transforms/input.hpp @@ -71,7 +71,7 @@ namespace winograd const int row_offset = (tile_i == 0) ? 0 : ((padding_type == PADDING_VALID) ? 0 : 1); const T* const input_base_row = ( - input_base_batch + ((inner_tile_rows - 2)*tile_i - row_offset)*input_row_stride + input_base_batch + ((inner_tile_rows - (kernel_rows - 1))*tile_i - row_offset)*input_row_stride ); T* const outptr_base_row = outptr_base_batch + tile_i*output_row_stride; diff --git a/arm_compute/core/NEON/kernels/winograd/transforms/output.hpp b/arm_compute/core/NEON/kernels/winograd/transforms/output.hpp index 7fa5ee9617..0dd719751b 100644 --- a/arm_compute/core/NEON/kernels/winograd/transforms/output.hpp +++ b/arm_compute/core/NEON/kernels/winograd/transforms/output.hpp @@ -35,6 +35,7 @@ namespace winograd const T* const matrix_base, const int matrix_stride, const int matrix_row_stride, + const T* const biases, T* const output ) { @@ -69,8 +70,9 @@ namespace winograd // Process the row process_tile_row( tile_N, output_shape.n_channels, matrix_tile_row, matrix_stride, - matrix_row_stride, outptr_row, output_row_stride, - output_col_stride, row_pad_bottom, pad_right + matrix_row_stride, biases, + outptr_row, output_row_stride, output_col_stride, row_pad_bottom, + pad_right ); } } @@ -85,6 +87,7 @@ namespace winograd const T* const matrix_base, const int matrix_stride, const int matrix_row_stride, + const T* const biases, T* const output, const int output_row_stride, const int output_col_stride, @@ -102,7 +105,7 @@ namespace winograd // Perform the output transformation tile_fns[row_pad_bottom][tile_pad_right]( - n_channels, matrix_row, matrix_stride, + n_channels, matrix_row, matrix_stride, biases, outptr, output_row_stride, output_col_stride ); } @@ -131,14 +134,17 @@ namespace winograd const T* const matrix_base, const int matrix_stride, const int matrix_row_stride, + const T* const biases, T* const output, const int n_batches, const int n_rows, const int n_cols, const int n_channels - ) : _matrix_base(matrix_base), _matrix_stride(matrix_stride), _matrix_row_stride(matrix_row_stride), - _outptr(output), _n_batches(n_batches), _n_rows(n_rows), _n_cols(n_cols), _n_channels(n_channels), - _tile_M(iceildiv(n_rows, output_tile_rows)), _tile_N(iceildiv(n_cols, output_tile_cols)) + ) : _matrix_base(matrix_base), _biases(biases), + _matrix_stride(matrix_stride), _matrix_row_stride(matrix_row_stride), + _outptr(output), _n_batches(n_batches), _n_rows(n_rows), _n_cols(n_cols), + _n_channels(n_channels), _tile_M(iceildiv(n_rows, output_tile_rows)), + _tile_N(iceildiv(n_cols, output_tile_cols)) { } @@ -168,7 +174,8 @@ namespace winograd _n_batches, _n_rows, _n_cols, _n_channels, NHWC }; execute( - output_shape, _matrix_base, _matrix_stride, _matrix_row_stride, _outptr + output_shape, _matrix_base, _matrix_stride, _matrix_row_stride, _biases, + _outptr ); } } // namespace winograd |