From f1aeab9cfb6e9a2a5a16ed79bf341ad11c555233 Mon Sep 17 00:00:00 2001 From: Matthew Bentham Date: Tue, 30 May 2023 13:35:34 +0000 Subject: Break up arm_compute/core/Types.h a bit Split some of the larger types with inlined code into their own header files, so that the implementation of them needn't be included everywhere. Change-Id: Id3ec2d42efbd33cedb55705a5a24e1b90c8b7a01 Signed-off-by: Matthew Bentham Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/c/VisualCompute/ComputeLibrary/+/524782 Tested-by: bsgcomp Reviewed-by: Gunes Bayir Comments-Addressed: bsgcomp Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9757 Tested-by: Arm Jenkins Reviewed-by: Pablo Marquez Tello Reviewed-by: Jakub Sujak Comments-Addressed: Arm Jenkins Benchmark: Arm Jenkins --- src/core/CL/kernels/CLBatchNormalizationLayerKernel.h | 3 ++- src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.h | 3 ++- src/core/NEON/kernels/NEBatchNormalizationLayerKernel.h | 3 ++- src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp | 3 ++- src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp | 3 ++- src/core/NEON/kernels/detail/NEActivationFunctionDetail.h | 3 ++- src/core/Utils.cpp | 9 +++++---- src/core/utils/AssemblyUtils.cpp | 4 +++- src/core/utils/AssemblyUtils.h | 4 +++- src/core/utils/quantization/AsymmHelpers.cpp | 1 + 10 files changed, 24 insertions(+), 12 deletions(-) (limited to 'src/core') diff --git a/src/core/CL/kernels/CLBatchNormalizationLayerKernel.h b/src/core/CL/kernels/CLBatchNormalizationLayerKernel.h index 743f4a9594..59ea8278ea 100644 --- a/src/core/CL/kernels/CLBatchNormalizationLayerKernel.h +++ b/src/core/CL/kernels/CLBatchNormalizationLayerKernel.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2020, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,6 +24,7 @@ #ifndef ARM_COMPUTE_CLBATCHNORMALIZATIONLAYERKERNEL_H #define ARM_COMPUTE_CLBATCHNORMALIZATIONLAYERKERNEL_H +#include "arm_compute/core/ActivationLayerInfo.h" #include "src/core/CL/ICLKernel.h" namespace arm_compute diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.h b/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.h index 5352f685ea..08e9c67f2c 100644 --- a/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.h +++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022 Arm Limited. + * Copyright (c) 2019-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -26,6 +26,7 @@ #include "src/core/CL/ICLKernel.h" +#include "arm_compute/core/ConvolutionInfo.h" #include "arm_compute/core/KernelDescriptors.h" namespace arm_compute diff --git a/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.h b/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.h index 9312073ce8..f06884f8c9 100644 --- a/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.h +++ b/src/core/NEON/kernels/NEBatchNormalizationLayerKernel.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2020, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,6 +24,7 @@ #ifndef ARM_COMPUTE_NEBATCHNORMALIZATIONLAYERKERNEL_H #define ARM_COMPUTE_NEBATCHNORMALIZATIONLAYERKERNEL_H +#include "arm_compute/core/ActivationLayerInfo.h" #include "src/core/NEON/INEKernel.h" namespace arm_compute diff --git a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp index c7cfd7457d..f7b75f07e1 100644 --- a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp +++ b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 Arm Limited. + * Copyright (c) 2020-2021,2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -21,6 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensorPack.h" #include "arm_compute/core/Window.h" diff --git a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp index b8a540158b..22089b1d07 100644 --- a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp +++ b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 Arm Limited. + * Copyright (c) 2020-2021,2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -21,6 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/ITensorPack.h" #include "arm_compute/core/Window.h" diff --git a/src/core/NEON/kernels/detail/NEActivationFunctionDetail.h b/src/core/NEON/kernels/detail/NEActivationFunctionDetail.h index 25d682d8ae..d03b6e9978 100644 --- a/src/core/NEON/kernels/detail/NEActivationFunctionDetail.h +++ b/src/core/NEON/kernels/detail/NEActivationFunctionDetail.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2021 Arm Limited. + * Copyright (c) 2018-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,6 +24,7 @@ #ifndef ARM_COMPUTE_DETAIL_NEACTIVATION_FUNCTION_DETAIL_H #define ARM_COMPUTE_DETAIL_NEACTIVATION_FUNCTION_DETAIL_H +#include "arm_compute/core/ActivationLayerInfo.h" #include "src/core/NEON/wrapper/wrapper.h" namespace arm_compute diff --git a/src/core/Utils.cpp b/src/core/Utils.cpp index d05a044fc8..392603d5e6 100644 --- a/src/core/Utils.cpp +++ b/src/core/Utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2022 Arm Limited. + * Copyright (c) 2016-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,6 +24,7 @@ #include "arm_compute/core/Helpers.h" +#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/Utils.h" #include @@ -160,7 +161,7 @@ const std::string &string_from_data_type(DataType dt) return dt_map[dt]; } -const std::string &string_from_activation_func(ActivationLayerInfo::ActivationFunction act) +const std::string &string_from_activation_func(const ActivationLayerInfo::ActivationFunction& act) { static std::map act_map = { @@ -555,7 +556,7 @@ QuantizationInfo get_softmax_output_quantization_info(DataType input_type, bool return QuantizationInfo(1.f / 256, 0); } -std::pair get_quantized_activation_min_max(ActivationLayerInfo act_info, DataType data_type, UniformQuantizationInfo oq_info) +std::pair get_quantized_activation_min_max(const ActivationLayerInfo& act_info, DataType data_type, UniformQuantizationInfo oq_info) { const bool is_qasymm8_signed = is_data_type_quantized_asymmetric_signed(data_type); const auto a = act_info.a(); @@ -687,4 +688,4 @@ int max_consecutive_elements_display_width(std::ostream &s, DataType dt, const u } #endif /* ARM_COMPUTE_ASSERTS_ENABLED */ -} // namespace arm_compute \ No newline at end of file +} // namespace arm_compute diff --git a/src/core/utils/AssemblyUtils.cpp b/src/core/utils/AssemblyUtils.cpp index 45e7ff78be..0efc6ac552 100644 --- a/src/core/utils/AssemblyUtils.cpp +++ b/src/core/utils/AssemblyUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Arm Limited. + * Copyright (c) 2021-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -23,6 +23,8 @@ */ #include "src/core/utils/AssemblyUtils.h" +#include "arm_compute/core/ActivationLayerInfo.h" + namespace arm_compute { namespace assembly_utils diff --git a/src/core/utils/AssemblyUtils.h b/src/core/utils/AssemblyUtils.h index 7514175ed6..60bad3b618 100644 --- a/src/core/utils/AssemblyUtils.h +++ b/src/core/utils/AssemblyUtils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Arm Limited. + * Copyright (c) 2021-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -30,6 +30,8 @@ namespace arm_compute { +class ActivationLayerInfo; + namespace assembly_utils { /** Performs a mapping between Compute Library ActivationLayerInfo and the assembly Activation structure. diff --git a/src/core/utils/quantization/AsymmHelpers.cpp b/src/core/utils/quantization/AsymmHelpers.cpp index f5b69c7a44..0dec56c451 100644 --- a/src/core/utils/quantization/AsymmHelpers.cpp +++ b/src/core/utils/quantization/AsymmHelpers.cpp @@ -21,6 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/utils/quantization/AsymmHelpers.h" #include "arm_compute/core/Helpers.h" #include "support/ToolchainSupport.h" -- cgit v1.2.1