From fff9a4cb56d3d3dbfe85db555eea4bc9b3143996 Mon Sep 17 00:00:00 2001 From: Omar Al Khatib Date: Tue, 28 Mar 2023 11:14:29 +0100 Subject: Add Cropping to CLBatchToSpace - Deprecate dynamic block shape interface - Iterate over output window instead of input window for simpler implementation and better performance. - Add cropping support and cropping tests Resolves [COMPMID-5865] Signed-off-by: Omar Al Khatib Change-Id: Ic67d44a6a39299ecdafc507f12e3dc5d517dfb62 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9385 Comments-Addressed: Arm Jenkins Reviewed-by: SiCong Li Tested-by: Arm Jenkins Benchmark: Arm Jenkins --- src/runtime/CL/functions/CLBatchToSpaceLayer.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/runtime/CL/functions') diff --git a/src/runtime/CL/functions/CLBatchToSpaceLayer.cpp b/src/runtime/CL/functions/CLBatchToSpaceLayer.cpp index d4342b456f..d7a409128d 100644 --- a/src/runtime/CL/functions/CLBatchToSpaceLayer.cpp +++ b/src/runtime/CL/functions/CLBatchToSpaceLayer.cpp @@ -43,14 +43,14 @@ CLBatchToSpaceLayer::CLBatchToSpaceLayer() CLBatchToSpaceLayer::~CLBatchToSpaceLayer() = default; -void CLBatchToSpaceLayer::configure(const ICLTensor *input, const ICLTensor *block_shape, ICLTensor *output, const CropInfo &crop_info) +void CLBatchToSpaceLayer::configure(const ICLTensor *input, const ICLTensor *block_shape, ICLTensor *output) { - configure(CLKernelLibrary::get().get_compile_context(), input, block_shape, output, crop_info); + ARM_COMPUTE_LOG_PARAMS(input, block_shape, output); + _batch_to_space_kernel->configure(CLKernelLibrary::get().get_compile_context(), input, block_shape, output); } -void CLBatchToSpaceLayer::configure(const CLCompileContext &compile_context, const ICLTensor *input, const ICLTensor *block_shape, ICLTensor *output, const CropInfo &crop_info) +void CLBatchToSpaceLayer::configure(const CLCompileContext &compile_context, const ICLTensor *input, const ICLTensor *block_shape, ICLTensor *output) { - ARM_COMPUTE_UNUSED(crop_info); ARM_COMPUTE_LOG_PARAMS(input, block_shape, output); _batch_to_space_kernel->configure(compile_context, input, block_shape, output); } @@ -62,21 +62,18 @@ void CLBatchToSpaceLayer::configure(const ICLTensor *input, int32_t block_shape_ void CLBatchToSpaceLayer::configure(const CLCompileContext &compile_context, const ICLTensor *input, int32_t block_shape_x, int32_t block_shape_y, ICLTensor *output, const CropInfo &crop_info) { - ARM_COMPUTE_UNUSED(crop_info); ARM_COMPUTE_LOG_PARAMS(input, block_shape_x, block_shape_y, output); - _batch_to_space_kernel->configure(compile_context, input, block_shape_x, block_shape_y, output); + _batch_to_space_kernel->configure(compile_context, input, block_shape_x, block_shape_y, output, crop_info); } -Status CLBatchToSpaceLayer::validate(const ITensorInfo *input, const ITensorInfo *block_shape, const ITensorInfo *output, const CropInfo &crop_info) +Status CLBatchToSpaceLayer::validate(const ITensorInfo *input, const ITensorInfo *block_shape, const ITensorInfo *output) { - ARM_COMPUTE_UNUSED(crop_info); return CLBatchToSpaceLayerKernel::validate(input, block_shape, output); } Status CLBatchToSpaceLayer::validate(const ITensorInfo *input, int32_t block_shape_x, int32_t block_shape_y, const ITensorInfo *output, const CropInfo &crop_info) { - ARM_COMPUTE_UNUSED(crop_info); - return CLBatchToSpaceLayerKernel::validate(input, block_shape_x, block_shape_y, output); + return CLBatchToSpaceLayerKernel::validate(input, block_shape_x, block_shape_y, output, crop_info); } void CLBatchToSpaceLayer::run() -- cgit v1.2.1