ArmNN
 21.08
RefLogicalUnaryWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include "Decoders.hpp"
10 #include "Encoders.hpp"
11 #include "RefWorkloadUtils.hpp"
12 
13 #include <Profiling.hpp>
14 
15 #include <armnn/TypesUtils.hpp>
16 
17 namespace armnn
18 {
19 
21  const WorkloadInfo& info)
23 {}
24 
26 {
28 }
29 
31 {
32  Execute(workingMemDescriptor.m_Inputs, workingMemDescriptor.m_Outputs);
33 }
34 
35 void RefLogicalUnaryWorkload::Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const
36 {
37  ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefLogicalUnaryWorkload_Execute");
38 
39  const TensorInfo& inputInfo = GetTensorInfo(inputs[0]);
40  const TensorInfo& outputInfo = GetTensorInfo(outputs[0]);
41 
42  const TensorShape& inShape = inputInfo.GetShape();
43  const TensorShape& outShape = outputInfo.GetShape();
44 
45  std::unique_ptr<Decoder<InType>> input = MakeDecoder<InType>(inputInfo, inputs[0]->Map());
46  std::unique_ptr<Encoder<OutType>> output = MakeEncoder<OutType>(outputInfo, outputs[0]->Map());
47 
49 
51  {
53  {
54  NotFunction(inShape, outShape, *input, *output);
55  break;
56  }
57  default:
58  {
59  throw InvalidArgumentException(std::string("Unsupported Logical Unary operation") +
61  }
62  }
63 }
64 
65 } // namespace armnn
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
const TensorShape & GetShape() const
Definition: Tensor.hpp:191
CPU Execution: Reference C++ kernels.
Copyright (c) 2021 ARM Limited and Contributors.
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:219
constexpr char const * GetUnaryOperationAsCString(UnaryOperation operation)
Definition: TypesUtils.hpp:71
RefLogicalUnaryWorkload(const ElementwiseUnaryQueueDescriptor &descriptor, const WorkloadInfo &info)
#define CHECK_LOCATION()
Definition: Exceptions.hpp:197
std::vector< ITensorHandle * > m_Outputs
void ExecuteAsync(WorkingMemDescriptor &workingMemDescriptor) override
Contains information about TensorInfos of a layer.
std::vector< ITensorHandle * > m_Inputs
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers