From 05288a2b871ef99f544771621c3bba409b2f70df Mon Sep 17 00:00:00 2001 From: Gian Marco Date: Tue, 21 Nov 2017 10:57:50 +0000 Subject: COMPMID-697 - Rework GEMMLowp interface on OpenCL Reworked the interface of GemmLowp in order to make easy the integration in Android NN - Added support for different output stage - Added validation for both matrix multiplication and output stage - Added bounded relu support in the output stage - Added in32_t bias support - Added optimized path for vector by matrix case This rework is required for: - Convolution quantized - Fully connected quantized Change-Id: I512283d406099cf8c614dd89d0a97ed411143afc Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/110625 Reviewed-by: Georgios Pinitas Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com --- src/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.cpp') diff --git a/src/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.cpp b/src/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.cpp index 92c911c370..da5ac22fdc 100644 --- a/src/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.cpp +++ b/src/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.cpp @@ -133,7 +133,10 @@ void NEGEMMLowpMatrixMultiplyCore::configure(const ITensor *a, const ITensor *b, if(_a_offset != 0) { TensorShape shape_vector_sum_col = b->info()->tensor_shape(); - shape_vector_sum_col.remove_dimension(1); + if(b->info()->num_dimensions() > 1) + { + shape_vector_sum_col.remove_dimension(1); + } TensorInfo info_vector_sum_col(shape_vector_sum_col, 1, DataType::S32); _vector_sum_col.allocator()->init(info_vector_sum_col); _memory_group.manage(&_vector_sum_col); @@ -147,7 +150,10 @@ void NEGEMMLowpMatrixMultiplyCore::configure(const ITensor *a, const ITensor *b, { TensorShape shape_vector_sum_row = a->info()->tensor_shape(); shape_vector_sum_row.set(Window::DimX, a->info()->dimension(1)); - shape_vector_sum_row.remove_dimension(1); + if(a->info()->num_dimensions() > 1) + { + shape_vector_sum_row.remove_dimension(1); + } TensorInfo info_vector_sum_row(shape_vector_sum_row, 1, DataType::S32); _vector_sum_row.allocator()->init(info_vector_sum_row); _memory_group.manage(&_vector_sum_row); -- cgit v1.2.1