aboutsummaryrefslogtreecommitdiff
path: root/src/backends/cl/workloads/ClGatherNdWorkload.hpp
blob: dd30024cc7474bafcb505fe776cb3d958f71fc55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//

#pragma once

#include "ClBaseWorkload.hpp"

#include "arm_compute/runtime/Tensor.h"
#include "arm_compute/runtime/CL/functions/CLGather.h"
#include "arm_compute/runtime/CL/functions/CLPixelWiseMultiplication.h"
#include "arm_compute/runtime/CL/functions/CLReductionOperation.h"
#include "arm_compute/runtime/CL/functions/CLReshapeLayer.h"

namespace armnn
{
arm_compute::Status ClGatherNdWorkloadValidate(const TensorInfo& params,
                                               const TensorInfo& indices,
                                               const TensorInfo& output);

class ClGatherNdWorkload : public ClBaseWorkload<GatherNdQueueDescriptor>
{
public:
    ClGatherNdWorkload(const GatherNdQueueDescriptor& descriptor,
                       const WorkloadInfo& info,
                       const arm_compute::CLCompileContext& clCompileContext);
    virtual void Execute() const override;

private:
    arm_compute::CLTensor m_FlattenedCoeff;
    arm_compute::CLTensor m_OutputMul;
    arm_compute::CLTensor m_FlattenedIndices;
    arm_compute::CLTensor m_OutputGather;

    mutable arm_compute::CLPixelWiseMultiplication m_MulLayer;
    mutable arm_compute::CLReductionOperation m_ReduceSumLayer;
    mutable arm_compute::CLGather m_GatherLayer;
    mutable arm_compute::CLReshapeLayer m_ReshapeLayer;
};

} //namespace armnn