ArmNN
 25.11
Loading...
Searching...
No Matches
NeonSqrtWorkload.cpp
Go to the documentation of this file.
1//
2// Copyright © 2022-2024 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
7
9
14
15namespace armnn
16{
17
18arm_compute::Status NeonSqrtWorkloadValidate(const TensorInfo& input, const TensorInfo& output)
19{
20 const arm_compute::TensorInfo aclInput = armcomputetensorutils::BuildArmComputeTensorInfo(input);
21 const arm_compute::TensorInfo aclOutput = armcomputetensorutils::BuildArmComputeTensorInfo(output);
22
23 ActivationDescriptor descriptor;
25 const arm_compute::ActivationLayerInfo activationLayerInfo =
27
28 return arm_compute::NEActivationLayer::validate(&aclInput, &aclOutput, activationLayerInfo);
29}
30
33{
35 {
36 throw InvalidArgumentException("NeonSqrtWorkload: The descriptor does not indicate a Sqrt operation.");
37 }
38
39 ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonSqrtWorkload_Construct",
40 descriptor.m_Parameters,
41 info,
42 this->GetGuid());
43
44 m_Data.ValidateInputsOutputs("NeonSqrtWorkload", 1, 1);
45
46 ActivationDescriptor activationDescriptor;
47 activationDescriptor.m_Function = ActivationFunction::Sqrt;
48 const arm_compute::ActivationLayerInfo activationLayerInfo =
50
51 arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
52 arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
53
54 m_SqrtLayer.configure(&input, &output, activationLayerInfo);
55}
56
58{
59 ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonSqrtWorkload_Execute");
60 m_SqrtLayer.run();
61}
62
63} // namespace armnn
#define ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
NeonBaseWorkload(const ElementwiseUnaryQueueDescriptor &descriptor, const WorkloadInfo &info)
NeonSqrtWorkload(const ElementwiseUnaryQueueDescriptor &descriptor, const WorkloadInfo &info)
virtual void Execute() const override
Copyright (c) 2021 ARM Limited and Contributors.
arm_compute::Status NeonSqrtWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
DestType PolymorphicDowncast(SourceType *value)
Polymorphic downcast for build in pointers only.
arm_compute::ActivationLayerInfo ConvertActivationDescriptorToAclActivationLayerInfo(const ActivationDescriptor &actDesc)
An ActivationDescriptor for the ActivationLayer.
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu,...
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
Contains information about TensorInfos of a layer.