ArmNN
 21.11
RefActivationWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include "Activation.hpp"
9 #include "Decoders.hpp"
10 #include "Encoders.hpp"
11 #include "RefWorkloadUtils.hpp"
12 
13 #include "Profiling.hpp"
14 
15 namespace armnn
16 {
17 
19 {
21 }
22 
24 {
25  Execute(workingMemDescriptor.m_Inputs, workingMemDescriptor.m_Outputs);
26 }
27 
28 void RefActivationWorkload::Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const
29 {
30  ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefActivationWorkload_Execute");
31 
32  const TensorInfo& inputInfo = GetTensorInfo(inputs[0]);
33  const TensorInfo& outputInfo = GetTensorInfo(outputs[0]);
34 
35  Activation(*MakeDecoder<float>(inputInfo, inputs[0]->Map()),
36  *MakeEncoder<float>(outputInfo, outputs[0]->Map()),
37  inputInfo,
41 }
42 
43 
44 } //namespace armnn
CPU Execution: Reference C++ kernels.
Copyright (c) 2021 ARM Limited and Contributors.
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:220
void ExecuteAsync(WorkingMemDescriptor &workingMemDescriptor) override
float m_A
Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH, Elu).
Definition: Descriptors.hpp:50
std::vector< ITensorHandle * > m_Outputs
std::vector< ITensorHandle * > m_Inputs
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
float m_B
Beta lower bound value used by the activation functions. (BoundedReLu, Linear, TanH).
Definition: Descriptors.hpp:52
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square, Elu).
Definition: Descriptors.hpp:48