From 71d9b57aac146ae3ad5648c1308a872cea90070d Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Fri, 6 Jul 2018 17:05:59 +0100 Subject: COMPMID-1381: Cleaned up the AssemblyHelper interface Introduced a new IFunction for when we'll fork the arm_gemm functions Increased encapsulation and abstraction of which method is used Change-Id: I5fd8b14b5c77e7f8ecb09029b5e2eccd10dbdcf4 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/139108 Tested-by: Jenkins Reviewed-by: Georgios Pinitas Reviewed-by: Pablo Tello --- .../functions/NEGEMMLowpAssemblyMatrixMultiplyCore.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/runtime/NEON/functions/NEGEMMLowpAssemblyMatrixMultiplyCore.cpp') diff --git a/src/runtime/NEON/functions/NEGEMMLowpAssemblyMatrixMultiplyCore.cpp b/src/runtime/NEON/functions/NEGEMMLowpAssemblyMatrixMultiplyCore.cpp index 98b476794d..9b5d02ca44 100644 --- a/src/runtime/NEON/functions/NEGEMMLowpAssemblyMatrixMultiplyCore.cpp +++ b/src/runtime/NEON/functions/NEGEMMLowpAssemblyMatrixMultiplyCore.cpp @@ -38,8 +38,8 @@ using namespace arm_compute; NEGEMMLowpAssemblyMatrixMultiplyCore::NEGEMMLowpAssemblyMatrixMultiplyCore(std::shared_ptr memory_manager) - : _memory_group(std::move(memory_manager)), _asm_glue_unsigned(), _asm_glue_signed(), _mm_kernel(nullptr), _mtx_a_reshape_kernel(nullptr), _mtx_b_reshape_kernel(nullptr), _tmp_a(), _tmp_b(), - _workspace(), _B_pretransposed() + : _memory_group(memory_manager), _asm_glue_unsigned(memory_manager), _asm_glue_signed(memory_manager), _mm_kernel(nullptr), _mtx_a_reshape_kernel(nullptr), _mtx_b_reshape_kernel(nullptr), _tmp_a(), + _tmp_b() { } @@ -53,18 +53,19 @@ void NEGEMMLowpAssemblyMatrixMultiplyCore::configure(const ITensor *a, const ITe ARM_COMPUTE_ERROR_ON_MSG((b)->info()->dimension(0) != (output)->info()->dimension(0), "The output matrix must have the same number of columns as the matrix B"); bool run_optimised = false; -#ifdef __aarch64__ switch(a->info()->data_type()) { case DataType::S8: { - run_optimised = setup_assembly_kernel(a, b, output, 1.f, 0.f, true, _workspace, _B_pretransposed, _memory_group, _asm_glue_signed); + _asm_glue_signed.configure(a, b, output, 1.f, 0.f, true); + run_optimised = _asm_glue_unsigned.is_configured(); break; } case DataType::QASYMM8: case DataType::U8: { - run_optimised = setup_assembly_kernel(a, b, output, 1.f, 0.f, true, _workspace, _B_pretransposed, _memory_group, _asm_glue_unsigned); + _asm_glue_unsigned.configure(a, b, output, 1.f, 0.f, true); + run_optimised = _asm_glue_unsigned.is_configured(); break; } default: @@ -73,7 +74,6 @@ void NEGEMMLowpAssemblyMatrixMultiplyCore::configure(const ITensor *a, const ITe break; } } -#endif /* __aarch64__ */ if(!run_optimised) { // The interleaved output matrix will have the following shape: [ a_height * 4, ceil(a_width / 4.0f) ] @@ -133,11 +133,11 @@ void NEGEMMLowpAssemblyMatrixMultiplyCore::run() NEScheduler::get().schedule(_mtx_b_reshape_kernel.get(), Window::DimY); } - if(_asm_glue_unsigned._optimised_kernel != nullptr) + if(_asm_glue_unsigned.is_configured()) { _asm_glue_unsigned.run(); } - else if(_asm_glue_signed._optimised_kernel != nullptr) + else if(_asm_glue_signed.is_configured()) { _asm_glue_signed.run(); } -- cgit v1.2.1