telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
Teresa Charlin | 588cbdf | 2022-01-19 15:55:37 +0000 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd and Contributors. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
Teresa Charlin | 588cbdf | 2022-01-19 15:55:37 +0000 | [diff] [blame] | 8 | #include "NeonBaseWorkload.hpp" |
Matthew Bentham | d80a712 | 2019-01-08 17:52:37 +0000 | [diff] [blame] | 9 | |
| 10 | #include <arm_compute/runtime/IFunction.h> |
| 11 | #include <arm_compute/runtime/Tensor.h> |
| 12 | |
| 13 | #include <memory> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 14 | |
| 15 | namespace armnn |
| 16 | { |
| 17 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 18 | arm_compute::Status NeonBatchNormalizationValidate(const TensorInfo& input, |
| 19 | const TensorInfo& output, |
| 20 | const TensorInfo& mean, |
| 21 | const TensorInfo& var, |
| 22 | const TensorInfo& beta, |
| 23 | const TensorInfo& gamma, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 24 | const BatchNormalizationDescriptor& descriptor, |
| 25 | const ActivationDescriptor* activationDescriptor = nullptr); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 26 | |
Teresa Charlin | 588cbdf | 2022-01-19 15:55:37 +0000 | [diff] [blame] | 27 | class NeonBatchNormalizationWorkload : public NeonBaseWorkload<BatchNormalizationQueueDescriptor> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 28 | { |
| 29 | public: |
Matthew Bentham | c48ac8c | 2018-12-12 16:15:59 +0000 | [diff] [blame] | 30 | NeonBatchNormalizationWorkload(const BatchNormalizationQueueDescriptor& descriptor, |
| 31 | const WorkloadInfo& info); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 32 | virtual void Execute() const override; |
| 33 | |
| 34 | private: |
Matthew Bentham | d80a712 | 2019-01-08 17:52:37 +0000 | [diff] [blame] | 35 | std::unique_ptr<arm_compute::IFunction> m_Layer; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 36 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 37 | std::unique_ptr<arm_compute::Tensor> m_Mean; |
| 38 | std::unique_ptr<arm_compute::Tensor> m_Variance; |
| 39 | std::unique_ptr<arm_compute::Tensor> m_Gamma; |
| 40 | std::unique_ptr<arm_compute::Tensor> m_Beta; |
| 41 | |
| 42 | void FreeUnusedTensors(); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | } //namespace armnn |
| 46 | |