blob: b298874334ee4e54633edb557f9b973390058d88 [file] [log] [blame]
Matteo Martincighab9e5252019-06-13 17:27:46 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "RefPreluWorkload.hpp"
7
8#include "RefWorkloadUtils.hpp"
9#include "PreluImpl.hpp"
10
11#include <Profiling.hpp>
12
13namespace armnn
14{
15
16RefPreluWorkload::RefPreluWorkload(const PreluQueueDescriptor& descriptor,
17 const WorkloadInfo& info)
18 : BaseWorkload(descriptor, info)
19{}
20
21void RefPreluWorkload::Execute() const
22{
Finn Williamsb8181f72021-04-07 10:23:21 +010023 Execute(m_Data.m_Inputs, m_Data.m_Outputs);
24}
25
26void RefPreluWorkload::ExecuteAsync(WorkingMemDescriptor &workingMemDescriptor)
27{
28 Execute(workingMemDescriptor.m_Inputs, workingMemDescriptor.m_Outputs);
29}
30
31void RefPreluWorkload::Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const
32{
Matteo Martincighab9e5252019-06-13 17:27:46 +010033 ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefPreluWorkload_Execute");
34
Finn Williamsb8181f72021-04-07 10:23:21 +010035 std::unique_ptr<Decoder<float>> inputDecoder = MakeDecoder<float>(GetTensorInfo(inputs[0]),
36 inputs[0]->Map());
37 std::unique_ptr<Decoder<float>> alphaDecoder = MakeDecoder<float>(GetTensorInfo(inputs[1]),
38 inputs[1]->Map());
39 std::unique_ptr<Encoder<float>> outputEncoder = MakeEncoder<float>(GetTensorInfo(outputs[0]),
40 outputs[0]->Map());
Matteo Martincighab9e5252019-06-13 17:27:46 +010041
42 PreluImpl(m_Data, *inputDecoder, *alphaDecoder, *outputEncoder);
43}
44
45} // namespace armnn