David Monahan | 36e6eae | 2023-07-26 18:37:45 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2023 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #include "NeonTileWorkload.hpp" |
| 6 | #include "NeonWorkloadUtils.hpp" |
| 7 | #include <aclCommon/ArmComputeUtils.hpp> |
| 8 | #include <vector> |
| 9 | #include <algorithm> |
| 10 | |
| 11 | using namespace armnn::armcomputetensorutils; |
| 12 | namespace armnn |
| 13 | { |
| 14 | arm_compute::Status NeonTileWorkloadValidate(const TensorInfo& input, |
| 15 | const TensorInfo& output, |
| 16 | const TileDescriptor& descriptor) |
| 17 | { |
| 18 | const arm_compute::TensorInfo aclInput = BuildArmComputeTensorInfo(input); |
| 19 | const arm_compute::TensorInfo aclOutput = BuildArmComputeTensorInfo(output); |
| 20 | |
| 21 | std::vector<unsigned int> aclMultiples = descriptor.m_Multiples; |
| 22 | std::reverse(aclMultiples.begin(),aclMultiples.end()); |
| 23 | |
| 24 | return arm_compute::NETile::validate(&aclInput, &aclOutput, aclMultiples); |
| 25 | } |
| 26 | |
| 27 | NeonTileWorkload::NeonTileWorkload(const armnn::TileQueueDescriptor& descriptor, |
| 28 | const armnn::WorkloadInfo& info) |
| 29 | : BaseWorkload<TileQueueDescriptor>(descriptor, info) |
| 30 | { |
| 31 | m_Data.ValidateInputsOutputs("NeonTileWorkload", 1, 1); |
| 32 | |
| 33 | std::vector<unsigned int> aclMultiples = descriptor.m_Parameters.m_Multiples; |
| 34 | std::reverse(aclMultiples.begin(),aclMultiples.end()); |
| 35 | |
| 36 | arm_compute::ITensor& input = static_cast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor(); |
| 37 | arm_compute::ITensor& output = static_cast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor(); |
| 38 | m_Layer.configure(&input, &output, aclMultiples); |
| 39 | } |
| 40 | |
| 41 | void NeonTileWorkload::Execute() const |
| 42 | { |
Mike Kelly | 7cbe781 | 2023-07-25 17:37:33 +0100 | [diff] [blame] | 43 | ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonTileWorkload_Execute"); |
David Monahan | 36e6eae | 2023-07-26 18:37:45 +0100 | [diff] [blame] | 44 | m_Layer.run(); |
| 45 | } |
| 46 | } //namespace armnn |