From e75a02b60736f37c34388c23c0ccee230f65da59 Mon Sep 17 00:00:00 2001 From: Gian Marco Date: Wed, 8 Nov 2017 12:24:09 +0000 Subject: COMPMID-675 - Reworked NEGEMMLowp interface/function The new interface makes NEGEMMLowp able to work with ASYMM8 data types. Implemented 2 new functions: - NEGEMMLowpMatrixMultiplyCore - NEGEMMLowpOutputStage These functions should make the integration in android NN doable For more information about GEMMLowp: https://github.com/google/gemmlowp/blob/master/doc/low-precision.md Change-Id: Ie2c775f45234f68ca53dba644b3a912b997fd890 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95504 Tested-by: Kaizen Reviewed-by: Pablo Tello --- tests/datasets/GEMMLowpDataset.h | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) (limited to 'tests/datasets/GEMMLowpDataset.h') diff --git a/tests/datasets/GEMMLowpDataset.h b/tests/datasets/GEMMLowpDataset.h index 4bf2a98d61..062c05b1d9 100644 --- a/tests/datasets/GEMMLowpDataset.h +++ b/tests/datasets/GEMMLowpDataset.h @@ -37,7 +37,7 @@ namespace datasets class GEMMLowpDataset { public: - using type = std::tuple; + using type = std::tuple; struct iterator { @@ -45,18 +45,12 @@ public: std::vector::const_iterator b_it, std::vector::const_iterator c_it, std::vector::const_iterator a_offset_it, - std::vector::const_iterator b_offset_it, - std::vector::const_iterator c_offset_it, - std::vector::const_iterator c_mult_int_it, - std::vector::const_iterator out_shift_it) + std::vector::const_iterator b_offset_it) : _a_it{ std::move(a_it) }, _b_it{ std::move(b_it) }, _c_it{ std::move(c_it) }, _a_offset_it{ std::move(a_offset_it) }, - _b_offset_it{ std::move(b_offset_it) }, - _c_offset_it{ std::move(c_offset_it) }, - _c_mult_int_it{ std::move(c_mult_int_it) }, - _out_shift_it{ std::move(out_shift_it) } + _b_offset_it{ std::move(b_offset_it) } { } @@ -68,15 +62,12 @@ public: description << "C=" << *_c_it << ":"; description << "a_offset=" << *_a_offset_it << ":"; description << "b_offset=" << *_b_offset_it << ":"; - description << "c_offset=" << *_c_offset_it << ":"; - description << "c_mult_int=" << *_c_mult_int_it << ":"; - description << "out_shift=" << *_out_shift_it << ":"; return description.str(); } GEMMLowpDataset::type operator*() const { - return std::make_tuple(*_a_it, *_b_it, *_c_it, *_a_offset_it, *_b_offset_it, *_c_offset_it, *_c_mult_int_it, *_out_shift_it); + return std::make_tuple(*_a_it, *_b_it, *_c_it, *_a_offset_it, *_b_offset_it); } iterator &operator++() @@ -86,9 +77,6 @@ public: ++_c_it; ++_a_offset_it; ++_b_offset_it; - ++_c_offset_it; - ++_c_mult_int_it; - ++_out_shift_it; return *this; } @@ -99,32 +87,25 @@ public: std::vector::const_iterator _c_it; std::vector::const_iterator _a_offset_it; std::vector::const_iterator _b_offset_it; - std::vector::const_iterator _c_offset_it; - std::vector::const_iterator _c_mult_int_it; - std::vector::const_iterator _out_shift_it; }; iterator begin() const { - return iterator(_a_shapes.begin(), _b_shapes.begin(), _c_shapes.begin(), _a_offset.begin(), _b_offset.begin(), _c_offset.begin(), _c_mult_int.begin(), _out_shift.begin()); + return iterator(_a_shapes.begin(), _b_shapes.begin(), _c_shapes.begin(), _a_offset.begin(), _b_offset.begin()); } int size() const { - return std::min(_a_shapes.size(), std::min(_b_shapes.size(), std::min(_c_shapes.size(), std::min(_a_offset.size(), std::min(_b_offset.size(), std::min(_c_offset.size(), std::min(_c_mult_int.size(), - _out_shift.size()))))))); + return std::min(_a_shapes.size(), std::min(_b_shapes.size(), std::min(_c_shapes.size(), std::min(_a_offset.size(), _b_offset.size())))); } - void add_config(TensorShape a, TensorShape b, TensorShape c, int32_t a_offset, int32_t b_offset, int32_t c_offset, int32_t c_mult_int, int32_t out_shift) + void add_config(TensorShape a, TensorShape b, TensorShape c, int32_t a_offset, int32_t b_offset) { _a_shapes.emplace_back(std::move(a)); _b_shapes.emplace_back(std::move(b)); _c_shapes.emplace_back(std::move(c)); _a_offset.emplace_back(std::move(a_offset)); _b_offset.emplace_back(std::move(b_offset)); - _c_offset.emplace_back(std::move(c_offset)); - _c_mult_int.emplace_back(std::move(c_mult_int)); - _out_shift.emplace_back(std::move(out_shift)); } protected: @@ -137,9 +118,6 @@ private: std::vector _c_shapes{}; std::vector _a_offset{}; std::vector _b_offset{}; - std::vector _c_offset{}; - std::vector _c_mult_int{}; - std::vector _out_shift{}; }; } // namespace datasets } // namespace test -- cgit v1.2.1