From 7e20e29904c98adae5a91c6492fd78da88b7a9bf Mon Sep 17 00:00:00 2001 From: Sheri Zhang Date: Tue, 2 Feb 2021 11:49:34 +0000 Subject: Make memset/copy functions state-less Port following functions: - CLCopy - CLFill - CLPermute - CLReshapeLayer - CLCropResize Resolves: COMPMID-4002 Signed-off-by: Sheri Zhang Change-Id: I8392aa515aaeb5b44dab6122be6a795d08376d5f Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5003 Comments-Addressed: Arm Jenkins Reviewed-by: Michele Di Giorgio Tested-by: Arm Jenkins --- src/runtime/CL/functions/CLGenerateProposalsLayer.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/runtime/CL/functions/CLGenerateProposalsLayer.cpp') diff --git a/src/runtime/CL/functions/CLGenerateProposalsLayer.cpp b/src/runtime/CL/functions/CLGenerateProposalsLayer.cpp index e536816f97..365f95243f 100644 --- a/src/runtime/CL/functions/CLGenerateProposalsLayer.cpp +++ b/src/runtime/CL/functions/CLGenerateProposalsLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -29,7 +29,6 @@ #include "src/core/CL/kernels/CLDequantizationLayerKernel.h" #include "src/core/CL/kernels/CLGenerateProposalsLayerKernel.h" #include "src/core/CL/kernels/CLPadLayerKernel.h" -#include "src/core/CL/kernels/CLPermuteKernel.h" #include "src/core/CL/kernels/CLQuantizationLayerKernel.h" #include "src/core/helpers/AutoConfiguration.h" @@ -37,9 +36,9 @@ namespace arm_compute { CLGenerateProposalsLayer::CLGenerateProposalsLayer(std::shared_ptr memory_manager) : _memory_group(memory_manager), - _permute_deltas_kernel(std::make_unique()), + _permute_deltas(), _flatten_deltas(), - _permute_scores_kernel(std::make_unique()), + _permute_scores(), _flatten_scores(), _compute_anchors_kernel(std::make_unique()), _bounding_box_kernel(std::make_unique()), @@ -110,7 +109,7 @@ void CLGenerateProposalsLayer::configure(const CLCompileContext &compile_context if(!_is_nhwc) { _memory_group.manage(&_deltas_permuted); - _permute_deltas_kernel->configure(compile_context, deltas, &_deltas_permuted, PermutationVector{ 2, 0, 1 }); + _permute_deltas.configure(compile_context, deltas, &_deltas_permuted, PermutationVector{ 2, 0, 1 }); _flatten_deltas.configure(compile_context, &_deltas_permuted, &_deltas_flattened); _deltas_permuted.allocator()->allocate(); } @@ -127,7 +126,7 @@ void CLGenerateProposalsLayer::configure(const CLCompileContext &compile_context if(!_is_nhwc) { _memory_group.manage(&_scores_permuted); - _permute_scores_kernel->configure(compile_context, scores, &_scores_permuted, PermutationVector{ 2, 0, 1 }); + _permute_scores.configure(compile_context, scores, &_scores_permuted, PermutationVector{ 2, 0, 1 }); _flatten_scores.configure(compile_context, &_scores_permuted, &_scores_flattened); _scores_permuted.allocator()->allocate(); } @@ -244,8 +243,8 @@ Status CLGenerateProposalsLayer::validate(const ITensorInfo *scores, const ITens } else { - ARM_COMPUTE_RETURN_ON_ERROR(CLPermuteKernel::validate(deltas, &deltas_permuted_info, PermutationVector{ 2, 0, 1 })); - ARM_COMPUTE_RETURN_ON_ERROR(CLPermuteKernel::validate(scores, &scores_permuted_info, PermutationVector{ 2, 0, 1 })); + ARM_COMPUTE_RETURN_ON_ERROR(CLPermute::validate(deltas, &deltas_permuted_info, PermutationVector{ 2, 0, 1 })); + ARM_COMPUTE_RETURN_ON_ERROR(CLPermute::validate(scores, &scores_permuted_info, PermutationVector{ 2, 0, 1 })); } TensorInfo deltas_flattened_info(deltas->clone()->set_tensor_shape(TensorShape(values_per_roi, total_num_anchors)).set_is_resizable(true)); @@ -356,8 +355,8 @@ void CLGenerateProposalsLayer::run() // Transpose and reshape the inputs if(!_is_nhwc) { - CLScheduler::get().enqueue(*_permute_deltas_kernel, false); - CLScheduler::get().enqueue(*_permute_scores_kernel, false); + _permute_deltas.run(); + _permute_scores.run(); } _flatten_deltas.run(); _flatten_scores.run(); -- cgit v1.2.1