ArmNN
 25.11
Loading...
Searching...
No Matches
RefLogicalUnaryWorkload.cpp
Go to the documentation of this file.
1//
2// Copyright © 2020-2024 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
17namespace armnn
18{
19
24
26{
27 Execute(m_Data.m_Inputs, m_Data.m_Outputs);
28}
29
30void RefLogicalUnaryWorkload::Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const
31{
32 ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID("RefLogicalUnaryWorkload_Execute");
33
34 const TensorInfo& inputInfo = GetTensorInfo(inputs[0]);
35 const TensorInfo& outputInfo = GetTensorInfo(outputs[0]);
36
37 const TensorShape& inShape = inputInfo.GetShape();
38 const TensorShape& outShape = outputInfo.GetShape();
39
40 std::unique_ptr<Decoder<InType>> input = MakeDecoder<InType>(inputInfo, inputs[0]->Map());
41 std::unique_ptr<Encoder<OutType>> output = MakeEncoder<OutType>(outputInfo, outputs[0]->Map());
42
44
46 {
48 {
49 NotFunction(inShape, outShape, *input, *output);
50 break;
51 }
52 default:
53 {
54 throw InvalidArgumentException(std::string("Unsupported Logical Unary operation") +
56 }
57 }
58}
59
60} // namespace armnn
#define CHECK_LOCATION()
#define ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
RefBaseWorkload(const ElementwiseUnaryQueueDescriptor &descriptor, const WorkloadInfo &info)
RefLogicalUnaryWorkload(const ElementwiseUnaryQueueDescriptor &descriptor, const WorkloadInfo &info)
const TensorShape & GetShape() const
Definition Tensor.hpp:193
Copyright (c) 2021 ARM Limited and Contributors.
constexpr char const * GetUnaryOperationAsCString(UnaryOperation operation)
std::unique_ptr< Decoder< T > > MakeDecoder(const TensorInfo &info, const void *data=nullptr)
std::unique_ptr< Encoder< T > > MakeEncoder(const TensorInfo &info, void *data=nullptr)
armnn::TensorInfo GetTensorInfo(unsigned int numberOfBatches, unsigned int numberOfChannels, unsigned int height, unsigned int width, const armnn::DataLayout dataLayout, const armnn::DataType dataType)
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
Contains information about TensorInfos of a layer.