From 68508897deafe26b5d50566a6ca3ba70c728dd12 Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Wed, 7 Apr 2021 19:18:08 +0100 Subject: Substitute CLFullyConnectedLayerReshapeWeights by CLTranspose Resolves partially: COMPMID-4359 (1/2) Signed-off-by: Teresa Charlin Change-Id: Id1859f3cd530eb05f027226e2004cf518778147e Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5377 Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins --- src/runtime/CL/functions/CLFullyConnectedLayer.cpp | 42 +--------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'src/runtime/CL/functions/CLFullyConnectedLayer.cpp') diff --git a/src/runtime/CL/functions/CLFullyConnectedLayer.cpp b/src/runtime/CL/functions/CLFullyConnectedLayer.cpp index 176c5bebd5..945675f4dd 100644 --- a/src/runtime/CL/functions/CLFullyConnectedLayer.cpp +++ b/src/runtime/CL/functions/CLFullyConnectedLayer.cpp @@ -141,46 +141,6 @@ Status validate_mm(const ITensorInfo &input, const ITensorInfo &weights, const I } } // namespace -struct CLFullyConnectedLayerReshapeWeights::Impl -{ - const ITensor *src{ nullptr }; - ITensor *dst{ nullptr }; - std::unique_ptr op{ nullptr }; -}; - -CLFullyConnectedLayerReshapeWeights::CLFullyConnectedLayerReshapeWeights() - : _impl(std::make_unique()) -{ -} - -CLFullyConnectedLayerReshapeWeights::~CLFullyConnectedLayerReshapeWeights() = default; - -void CLFullyConnectedLayerReshapeWeights::configure(const ICLTensor *input, ICLTensor *output) -{ - configure(CLKernelLibrary::get().get_compile_context(), input, output); -} - -void CLFullyConnectedLayerReshapeWeights::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output) -{ - _impl->src = input; - _impl->dst = output; - _impl->op = std::make_unique(); - _impl->op->configure(compile_context, _impl->src->info(), _impl->dst->info()); -} - -Status CLFullyConnectedLayerReshapeWeights::validate(const ITensorInfo *input, const ITensorInfo *output) -{ - return opencl::kernels::ClTransposeKernel::validate(input, output); -} - -void CLFullyConnectedLayerReshapeWeights::run() -{ - ITensorPack pack{}; - pack.add_tensor(TensorType::ACL_SRC, _impl->src); - pack.add_tensor(TensorType::ACL_DST, _impl->dst); - CLScheduler::get().enqueue_op(*_impl->op.get(), pack, false); -} - CLFullyConnectedLayer::CLFullyConnectedLayer(std::shared_ptr memory_manager, IWeightsManager *weights_manager) : _memory_group(memory_manager), _weights_manager(weights_manager), _convert_weights(), _convert_weights_managed(), _reshape_weights_managed_function(), _flatten_layer(), _reshape_weights_function(), _mm_gemm(memory_manager, weights_manager), _mm_gemmlowp(memory_manager), _flatten_output(), _converted_weights_output(), _reshape_weights_output(), _are_weights_converted(true), @@ -404,7 +364,7 @@ Status CLFullyConnectedLayer::validate(const ITensorInfo *input, const ITensorIn if(!weights_reshaped) { // Validate reshape weights kernel - ARM_COMPUTE_RETURN_ON_ERROR(CLFullyConnectedLayerReshapeWeights::validate(weights, &reshaped_weights)); + ARM_COMPUTE_RETURN_ON_ERROR(CLTranspose::validate(weights, &reshaped_weights)); weights_to_use = &reshaped_weights; } -- cgit v1.2.1