diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2017-09-08 19:47:30 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | baf174e85ddb5399355281cd34d0f459d92124a7 (patch) | |
tree | d69904df66f7e5ad55edd268d16735542445f36f /src/runtime/NEON/functions/NESoftmaxLayer.cpp | |
parent | 1c8409d7ce90ea449437076574c98a4ea90d9368 (diff) | |
download | ComputeLibrary-baf174e85ddb5399355281cd34d0f459d92124a7.tar.gz |
COMPMID-485: Memory Manager
Change-Id: Ib421b7622838f050038cd81e7426bb1413a7d6e6
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/87376
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/runtime/NEON/functions/NESoftmaxLayer.cpp')
-rw-r--r-- | src/runtime/NEON/functions/NESoftmaxLayer.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/runtime/NEON/functions/NESoftmaxLayer.cpp b/src/runtime/NEON/functions/NESoftmaxLayer.cpp index 13dfa4a51e..cc5d4e91c3 100644 --- a/src/runtime/NEON/functions/NESoftmaxLayer.cpp +++ b/src/runtime/NEON/functions/NESoftmaxLayer.cpp @@ -31,8 +31,8 @@ using namespace arm_compute; -NESoftmaxLayer::NESoftmaxLayer() - : _max_kernel(), _shift_exp_sum_kernel(), _norm_kernel(), _fill_border_kernel(), _max(), _sum(), _tmp() +NESoftmaxLayer::NESoftmaxLayer(std::shared_ptr<IMemoryManager> memory_manager) + : _memory_group(std::move(memory_manager)), _max_kernel(), _shift_exp_sum_kernel(), _norm_kernel(), _fill_border_kernel(), _max(), _sum(), _tmp() { } @@ -50,6 +50,11 @@ void NESoftmaxLayer::configure(ITensor *input, ITensor *output) _max.allocator()->init(tensor_info_max_sum); _sum.allocator()->init(tensor_info_max_sum); + // Manage intermediate buffers + _memory_group.manage(&_tmp); + _memory_group.manage(&_max); + _memory_group.manage(&_sum); + // Configure Kernels _max_kernel.configure(input, &_max); _shift_exp_sum_kernel.configure(input, &_max, &_tmp, &_sum); @@ -64,8 +69,12 @@ void NESoftmaxLayer::configure(ITensor *input, ITensor *output) void NESoftmaxLayer::run() { + _memory_group.acquire(); + NEScheduler::get().schedule(&_fill_border_kernel, Window::DimY); NEScheduler::get().schedule(&_max_kernel, Window::DimY); NEScheduler::get().schedule(&_shift_exp_sum_kernel, Window::DimY); NEScheduler::get().schedule(&_norm_kernel, Window::DimY); + + _memory_group.release(); } |