aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/workloads/RefPreluWorkload.cpp
diff options
context:
space:
mode:
authorMatteo Martincigh <matteo.martincigh@arm.com>2019-06-13 17:27:46 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-06-19 11:12:35 +0000
commitab9e52563f624d9782b97400f643d2632cc8d770 (patch)
tree5fec7f9e398dbd2337241cd3cc908f7b0e1d588b /src/backends/reference/workloads/RefPreluWorkload.cpp
parentbee4bc944aa50782ff22cb4a31fbc611212a5e89 (diff)
downloadarmnn-ab9e52563f624d9782b97400f643d2632cc8d770.tar.gz
IVGCVSW-3268 Add Reference workload support for the new Prelu Activation layer
* Added reference workload for the PReLU Activation layer * Added factory methods * Added validation support * Added Int16 support * Added unit tests Change-Id: Ic950d908c5e0a335dccd2960a3ffab0f8b599876 Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Diffstat (limited to 'src/backends/reference/workloads/RefPreluWorkload.cpp')
-rw-r--r--src/backends/reference/workloads/RefPreluWorkload.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/backends/reference/workloads/RefPreluWorkload.cpp b/src/backends/reference/workloads/RefPreluWorkload.cpp
new file mode 100644
index 0000000000..cdc0a63711
--- /dev/null
+++ b/src/backends/reference/workloads/RefPreluWorkload.cpp
@@ -0,0 +1,35 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include "RefPreluWorkload.hpp"
+
+#include "RefWorkloadUtils.hpp"
+#include "PreluImpl.hpp"
+
+#include <Profiling.hpp>
+
+namespace armnn
+{
+
+RefPreluWorkload::RefPreluWorkload(const PreluQueueDescriptor& descriptor,
+ const WorkloadInfo& info)
+ : BaseWorkload(descriptor, info)
+{}
+
+void RefPreluWorkload::Execute() const
+{
+ ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefPreluWorkload_Execute");
+
+ std::unique_ptr<Decoder<float>> inputDecoder = MakeDecoder<float>(GetTensorInfo(m_Data.m_Inputs[0]),
+ m_Data.m_Inputs[0]->Map());
+ std::unique_ptr<Decoder<float>> alphaDecoder = MakeDecoder<float>(GetTensorInfo(m_Data.m_Inputs[1]),
+ m_Data.m_Inputs[1]->Map());
+ std::unique_ptr<Encoder<float>> outputEncoder = MakeEncoder<float>(GetTensorInfo(m_Data.m_Outputs[0]),
+ m_Data.m_Outputs[0]->Map());
+
+ PreluImpl(m_Data, *inputDecoder, *alphaDecoder, *outputEncoder);
+}
+
+} // namespace armnn