aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLGEMM.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-04-24 15:14:12 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:54 +0000
commit82b51482479951cf133c223eb81aae291cb4d590 (patch)
treef7ce7b0f169755234f788d68e296a769230e9964 /src/runtime/CL/functions/CLGEMM.cpp
parent35aa6a36e7ef9302efd554aac9b84153ad7c6a9e (diff)
downloadComputeLibrary-82b51482479951cf133c223eb81aae291cb4d590.tar.gz
COMPMID-959: Sets memory manager to CLWinograd
-Sets memory manager to Winograd functions -Marks CLGEMM inputs as unused if needed Change-Id: I425a3f864c756e0e2b4da895e1730b8822149ba8 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128891 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLGEMM.cpp')
-rw-r--r--src/runtime/CL/functions/CLGEMM.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/runtime/CL/functions/CLGEMM.cpp b/src/runtime/CL/functions/CLGEMM.cpp
index cf41eccc35..bff5781300 100644
--- a/src/runtime/CL/functions/CLGEMM.cpp
+++ b/src/runtime/CL/functions/CLGEMM.cpp
@@ -92,8 +92,8 @@ Status validate_arguments(const ITensorInfo *a, const ITensorInfo *b, const ICLT
} // namespace
CLGEMM::CLGEMM(std::shared_ptr<IMemoryManager> memory_manager)
- : _memory_group(std::move(memory_manager)), _interleave_kernel(), _transpose_kernel(), _mm_kernel(), _ma_kernel(), _tmp_a(), _tmp_b(), _is_interleaved_transposed(false), _run_addition(false),
- _is_first_run(true), _reshape_b_only_on_first_run(false)
+ : _memory_group(std::move(memory_manager)), _interleave_kernel(), _transpose_kernel(), _mm_kernel(), _ma_kernel(), _tmp_a(), _tmp_b(), _original_b(nullptr), _is_interleaved_transposed(false),
+ _run_addition(false), _is_first_run(true), _reshape_b_only_on_first_run(false)
{
}
@@ -104,6 +104,9 @@ void CLGEMM::configure(const ICLTensor *a, const ICLTensor *b, const ICLTensor *
// Perform validation step
ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(a->info(), b->info(), c, output->info(), alpha, beta, gemm_info));
+ // Store original b matrix
+ _original_b = b;
+
// Check if we need to reshape the matrix B only on the first run
_reshape_b_only_on_first_run = gemm_info.reshape_b_only_on_first_run();
@@ -192,7 +195,11 @@ void CLGEMM::run()
// Run transpose kernel
CLScheduler::get().enqueue(_transpose_kernel, false);
- _is_first_run = false;
+ // Mark original b matrix as unused
+ if(_reshape_b_only_on_first_run)
+ {
+ _original_b->mark_as_unused();
+ }
}
else if(!_reshape_b_only_on_first_run)
{
@@ -211,4 +218,6 @@ void CLGEMM::run()
}
_memory_group.release();
+
+ _is_first_run = false;
}