aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2021-03-19 15:06:07 +0000
committerGeorgios Pinitas <georgios.pinitas@arm.com>2021-03-29 19:48:22 +0000
commit702dc0c71f2b2830b63e3b4079ede0ef76377f0a (patch)
treeafb0dacd74a8650350802aea8043822503c2f8b2 /src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp
parent26c5c0fc10cbee1b523af0b27f884719dc50820a (diff)
downloadComputeLibrary-702dc0c71f2b2830b63e3b4079ede0ef76377f0a.tar.gz
Remove usage of valid window region CL - NHWC
Resolves: COMPMID-4153 Change-Id: Ib0d60c9acaac8aaf3946c62fc2d740b5ec6cee5c Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5301 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp b/src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp
index f9e1cbec27..50c4e24c33 100644
--- a/src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp
+++ b/src/core/CL/kernels/CLInstanceNormalizationLayerKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020 Arm Limited.
+ * Copyright (c) 2019-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -54,21 +54,6 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, c
return Status{};
}
-
-std::tuple<Status, Window> validate_and_configure_window(ITensorInfo *input, ITensorInfo *output)
-{
- // We handle the planes manually
- Window win = calculate_max_window(*input, Steps(1));
-
- // Output auto initialization if not yet initialized
- auto_init_if_empty(*output, input->tensor_shape(), 1, input->data_type());
-
- // CLInstanceNormalizationLayerKernel doesn't need padding so update_window_and_padding() can be skipped
- Coordinates coord;
- coord.set_num_dimensions(output->num_dimensions());
- output->set_valid_region(ValidRegion(coord, output->tensor_shape()));
- return std::make_pair(Status{}, win);
-}
} // namespace
CLInstanceNormalizationLayerKernel::CLInstanceNormalizationLayerKernel()
@@ -110,16 +95,19 @@ void CLInstanceNormalizationLayerKernel::configure(const CLCompileContext &compi
_kernel = create_kernel(compile_context, "instance_normalization", build_opts.options());
// Configure kernel window
- auto win_config = validate_and_configure_window(_input->info(), _output->info());
- ARM_COMPUTE_ERROR_THROW_ON(std::get<0>(win_config));
- ICLKernel::configure_internal(std::get<1>(win_config));
+ Window win = calculate_max_window(*input->info(), Steps(1));
+ if(output != nullptr)
+ {
+ auto_init_if_empty(*output->info(), input->info()->tensor_shape(), 1, input->info()->data_type());
+ }
+
+ ICLKernel::configure_internal(win);
ARM_COMPUTE_ERROR_ON(has_padding_changed(padding_info));
}
Status CLInstanceNormalizationLayerKernel::validate(const ITensorInfo *input, const ITensorInfo *output, const InstanceNormalizationLayerKernelInfo &info)
{
ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, output, info));
- ARM_COMPUTE_RETURN_ON_ERROR(std::get<0>(validate_and_configure_window(input->clone().get(), (output == nullptr ? input->clone().get() : output->clone().get()))));
return Status{};
}