ArmNN
 25.11
Loading...
Searching...
No Matches
ClGatherNdWorkload.hpp
Go to the documentation of this file.
1//
2// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include "ClBaseWorkload.hpp"
9
10#include "arm_compute/runtime/Tensor.h"
11#include "arm_compute/runtime/CL/functions/CLGather.h"
12#include "arm_compute/runtime/CL/functions/CLPixelWiseMultiplication.h"
13#include "arm_compute/runtime/CL/functions/CLReductionOperation.h"
14#include "arm_compute/runtime/CL/functions/CLReshapeLayer.h"
15
16namespace armnn
17{
18arm_compute::Status ClGatherNdWorkloadValidate(const TensorInfo& params,
19 const TensorInfo& indices,
20 const TensorInfo& output);
21
22class ClGatherNdWorkload : public ClBaseWorkload<GatherNdQueueDescriptor>
23{
24public:
26 const WorkloadInfo& info,
27 const arm_compute::CLCompileContext& clCompileContext);
28 virtual void Execute() const override;
29
30private:
31 arm_compute::CLTensor m_InputGather;
32 arm_compute::CLTensor m_FlattenedCoeff;
33 arm_compute::CLTensor m_OutputMul;
34 arm_compute::CLTensor m_FlattenedIndices;
35 arm_compute::CLTensor m_OutputGather;
36 arm_compute::CLTensor m_IndicesReshaped;
37
38 mutable arm_compute::CLPixelWiseMultiplication m_MulLayer;
39 mutable arm_compute::CLReductionOperation m_ReduceSumLayer;
40 mutable arm_compute::CLGather m_GatherLayer;
41 mutable arm_compute::CLReshapeLayer m_ReshapeInputLayer;
42 mutable arm_compute::CLReshapeLayer m_ReshapeOutputLayer;
43 mutable arm_compute::CLReshapeLayer m_ReshapeIndicesLayer;
44};
45
46} //namespace armnn
ClBaseWorkload(const GatherNdQueueDescriptor &descriptor, const WorkloadInfo &info)
ClGatherNdWorkload(const GatherNdQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
virtual void Execute() const override
Copyright (c) 2021 ARM Limited and Contributors.
arm_compute::Status ClGatherNdWorkloadValidate(const TensorInfo &paramsInfo, const TensorInfo &indicesInfo, const TensorInfo &outputInfo)
Contains information about TensorInfos of a layer.