diff options
author | Sheri Zhang <sheri.zhang@arm.com> | 2021-02-02 11:49:34 +0000 |
---|---|---|
committer | Sheri Zhang <sheri.zhang@arm.com> | 2021-02-08 13:35:26 +0000 |
commit | 7e20e29904c98adae5a91c6492fd78da88b7a9bf (patch) | |
tree | 96309359fd28c2244984ed1d4d1a9069528b64dc /src/runtime/CL/functions/CLGenerateProposalsLayer.cpp | |
parent | afc9c3df7600dcecf12d3d3a4686d2008502a813 (diff) | |
download | ComputeLibrary-7e20e29904c98adae5a91c6492fd78da88b7a9bf.tar.gz |
Make memset/copy functions state-less
Port following functions:
- CLCopy
- CLFill
- CLPermute
- CLReshapeLayer
- CLCropResize
Resolves: COMPMID-4002
Signed-off-by: Sheri Zhang <sheri.zhang@arm.com>
Change-Id: I8392aa515aaeb5b44dab6122be6a795d08376d5f
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5003
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLGenerateProposalsLayer.cpp')
-rw-r--r-- | src/runtime/CL/functions/CLGenerateProposalsLayer.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
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<IMemoryManager> memory_manager) : _memory_group(memory_manager), - _permute_deltas_kernel(std::make_unique<CLPermuteKernel>()), + _permute_deltas(), _flatten_deltas(), - _permute_scores_kernel(std::make_unique<CLPermuteKernel>()), + _permute_scores(), _flatten_scores(), _compute_anchors_kernel(std::make_unique<CLComputeAllAnchorsKernel>()), _bounding_box_kernel(std::make_unique<CLBoundingBoxTransformKernel>()), @@ -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(); |