Laurent Carlier | 749294b | 2020-06-01 09:03:17 +0100 | [diff] [blame] | 1 | // |
Nattapat Chaimanowong | ae2c5f0 | 2019-04-24 16:19:57 +0100 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "RefActivationWorkload.hpp" |
| 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 | |
| 18 | void RefActivationWorkload::Execute() const |
| 19 | { |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 20 | Execute(m_Data.m_Inputs, m_Data.m_Outputs); |
| 21 | } |
| 22 | |
| 23 | void RefActivationWorkload::ExecuteAsync(WorkingMemDescriptor &workingMemDescriptor) |
| 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 | { |
Nattapat Chaimanowong | ae2c5f0 | 2019-04-24 16:19:57 +0100 | [diff] [blame] | 30 | ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefActivationWorkload_Execute"); |
| 31 | |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 32 | const TensorInfo& inputInfo = GetTensorInfo(inputs[0]); |
| 33 | const TensorInfo& outputInfo = GetTensorInfo(outputs[0]); |
Nattapat Chaimanowong | ae2c5f0 | 2019-04-24 16:19:57 +0100 | [diff] [blame] | 34 | |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 35 | Activation(*MakeDecoder<float>(inputInfo, inputs[0]->Map()), |
| 36 | *MakeEncoder<float>(outputInfo, outputs[0]->Map()), |
Nattapat Chaimanowong | ae2c5f0 | 2019-04-24 16:19:57 +0100 | [diff] [blame] | 37 | inputInfo, |
| 38 | m_Data.m_Parameters.m_Function, |
| 39 | m_Data.m_Parameters.m_A, |
| 40 | m_Data.m_Parameters.m_B); |
| 41 | } |
| 42 | |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 43 | |
Nattapat Chaimanowong | ae2c5f0 | 2019-04-24 16:19:57 +0100 | [diff] [blame] | 44 | } //namespace armnn |