ArmNN
 25.11
Loading...
Searching...
No Matches
NeonFloorFloatWorkload.cpp
Go to the documentation of this file.
1//
2// Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
7
9
11
12#include <arm_compute/runtime/NEON/functions/NEFloor.h>
13
14namespace armnn
15{
17 const WorkloadInfo& info)
19{
20 m_Data.ValidateInputsOutputs("NeonFloorFloatWorkload", 1, 1);
21
22 arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
23 arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
24
25 auto layer = std::make_unique<arm_compute::NEFloor>();
26 layer->configure(&input, &output);
27 m_Layer.reset(layer.release());
28}
29
31{
32 ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonFloorFloatWorkload_Execute");
33 m_Layer->run();
34}
35
37{
38 ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot];
39 this->m_Data.m_Inputs[slot] = tensorHandle;
40 try
41 {
42 Reconfigure();
43 }
45 {
46 // Cannot reconfigure, revert the slot back and throw the exception.
47 this->m_Data.m_Inputs[slot] = backupHandle;
48 throw e;
49 }
50}
51
52// Replace output tensor handle with the given TensorHandle
54{
55 ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot];
56 this->m_Data.m_Inputs[slot] = tensorHandle;
57 try
58 {
59 Reconfigure();
60 }
62 {
63 // Cannot reconfigure, revert the slot back and throw the exception.
64 this->m_Data.m_Inputs[slot] = backupHandle;
65 throw e;
66 }
67}
68
69void NeonFloorFloatWorkload::Reconfigure()
70{
71 throw armnn::UnimplementedException("Reconfigure not implemented for this workload");
72}
73
74} //namespace armnn
75
76
77
#define ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
QueueDescriptor m_Data
Definition Workload.hpp:74
NeonFloorFloatWorkload(const FloorQueueDescriptor &descriptor, const WorkloadInfo &info)
void ReplaceInputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
void ReplaceOutputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
virtual void Execute() const override
Copyright (c) 2021 ARM Limited and Contributors.
DestType PolymorphicDowncast(SourceType *value)
Polymorphic downcast for build in pointers only.
TypedWorkload< QueueDescriptor, armnn::DataType::Float16, armnn::DataType::Float32 > FloatWorkload
Definition Workload.hpp:195
Contains information about TensorInfos of a layer.