aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLFullyConnectedLayer.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2021-08-17 16:09:10 +0100
committerGiorgio Arena <giorgio.arena@arm.com>2021-08-18 09:42:38 +0000
commitf5d51f33308dd5754a9d6a4633b2b5501ed1ada8 (patch)
treea53eeece8fa5db6e633d143494784cad0e539092 /src/runtime/CL/functions/CLFullyConnectedLayer.cpp
parent8273676c64a032794c1eba06e43dec8cd93b2314 (diff)
downloadComputeLibrary-f5d51f33308dd5754a9d6a4633b2b5501ed1ada8.tar.gz
Retain weights in ClGemm when reconfiguring the operator with retention
- Reduces the size of the WeightRetentions tests - Ensure the weights are retained the only the Src,Dst are updated Resolves: COMPMID-4775 Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Change-Id: If12daa4bd4bf89ec28faa743fb7291895cbe7b7c Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6121 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLFullyConnectedLayer.cpp')
-rw-r--r--src/runtime/CL/functions/CLFullyConnectedLayer.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/runtime/CL/functions/CLFullyConnectedLayer.cpp b/src/runtime/CL/functions/CLFullyConnectedLayer.cpp
index c719a667a7..6836c12022 100644
--- a/src/runtime/CL/functions/CLFullyConnectedLayer.cpp
+++ b/src/runtime/CL/functions/CLFullyConnectedLayer.cpp
@@ -76,7 +76,7 @@ void CLFullyConnectedLayer::configure(const CLCompileContext &compile_context, c
_impl->op = std::make_unique<opencl::ClFullyConnected>();
_impl->original_weights = weights;
- _impl->is_prepared = false;
+ _impl->is_prepared = fc_info.retain_internal_weights;
_impl->op->configure(compile_context, input->info(), weights->info(), (biases != nullptr) ? biases->info() : nullptr, output->info(), fc_info);
@@ -85,9 +85,17 @@ void CLFullyConnectedLayer::configure(const CLCompileContext &compile_context, c
_impl->weights_manager->manage(weights);
}
- _impl->aux_mem_req = _impl->op->workspace();
- _impl->run_pack = { { ACL_SRC_0, input }, { ACL_SRC_1, weights }, { ACL_SRC_2, biases }, { ACL_DST, output } };
- _impl->workspace = manage_workspace<CLTensor>(_impl->aux_mem_req, _impl->memory_group, _impl->run_pack, _impl->run_pack);
+ if(!_impl->is_prepared)
+ {
+ _impl->aux_mem_req = _impl->op->workspace();
+ _impl->run_pack = { { ACL_SRC_0, input }, { ACL_SRC_1, weights }, { ACL_SRC_2, biases }, { ACL_DST, output } };
+ _impl->workspace = manage_workspace<CLTensor>(_impl->aux_mem_req, _impl->memory_group, _impl->run_pack, _impl->run_pack);
+ }
+ else
+ {
+ _impl->run_pack.add_tensor(ACL_SRC_0, input);
+ _impl->run_pack.add_tensor(ACL_DST, output);
+ }
}
Status CLFullyConnectedLayer::validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output,