blob: 8ff5707ad682e09aba169e6aba6afb0cfb636cf1 [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5
6#pragma once
7
David Beckac42efd2018-09-26 17:41:13 +01008#include <backends/Workload.hpp>
9#include <backends/WorkloadData.hpp>
telsoa014fcda012018-03-09 14:13:49 +000010
11#include <armnn/TypesUtils.hpp>
12#include <arm_compute/runtime/CL/functions/CLPermute.h>
13
14#include <string>
15
16namespace armnn
17{
18
19arm_compute::Status ClPermuteWorkloadValidate(const PermuteDescriptor& descriptor);
20
telsoa01c577f2c2018-08-31 09:22:23 +010021template<armnn::DataType... DataTypes>
22class ClPermuteWorkload : public TypedWorkload<PermuteQueueDescriptor, DataTypes...>
telsoa014fcda012018-03-09 14:13:49 +000023{
24public:
25 static const std::string& GetName()
26 {
telsoa01c577f2c2018-08-31 09:22:23 +010027 static const std::string name = std::string("ClPermuteWorkload");
telsoa014fcda012018-03-09 14:13:49 +000028 return name;
29 }
30
31 ClPermuteWorkload(const PermuteQueueDescriptor& descriptor, const WorkloadInfo& info);
32 void Execute() const override;
33
34private:
telsoa01c577f2c2018-08-31 09:22:23 +010035 using TypedWorkload<PermuteQueueDescriptor, DataTypes...>::m_Data;
telsoa014fcda012018-03-09 14:13:49 +000036 mutable arm_compute::CLPermute m_PermuteFunction;
37};
38
telsoa01c577f2c2018-08-31 09:22:23 +010039using ClPermuteFloatWorkload = ClPermuteWorkload<DataType::Float16, DataType::Float32>;
telsoa014fcda012018-03-09 14:13:49 +000040using ClPermuteUint8Workload = ClPermuteWorkload<DataType::QuantisedAsymm8>;
41
telsoa01c577f2c2018-08-31 09:22:23 +010042} // namespace armnn