blob: d752290444d154328fee7f2c20ac300b4c4caded [file] [log] [blame]
Nattapat Chaimanowonga76698c2018-10-11 10:29:15 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "ClReshapeWorkload.hpp"
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +00007#include <cl/ClTensorHandle.hpp>
8#include <backendsCommon/CpuTensorHandle.hpp>
Nattapat Chaimanowonga76698c2018-10-11 10:29:15 +01009
10#include "ClWorkloadUtils.hpp"
11
12namespace armnn
13{
14
Kevin Maya023c402019-12-12 17:28:05 +000015arm_compute::Status ClReshapeWorkloadValidate(const TensorInfo& input,
16 const TensorInfo& output)
17{
18 const arm_compute::TensorInfo aclInputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(input);
19 const arm_compute::TensorInfo aclOutputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(output);
20
21 return arm_compute::CLReshapeLayer::validate(&aclInputInfo, &aclOutputInfo);
22}
23
Nattapat Chaimanowonga76698c2018-10-11 10:29:15 +010024ClReshapeWorkload::ClReshapeWorkload(const ReshapeQueueDescriptor& descriptor, const WorkloadInfo& info)
25 : BaseWorkload<ReshapeQueueDescriptor>(descriptor, info)
26{
27 m_Data.ValidateInputsOutputs("ClReshapeWorkload", 1, 1);
28
29 arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
30 arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
31
32 m_Layer.configure(&input, &output);
33}
34
35void ClReshapeWorkload::Execute() const
36{
37 ARMNN_SCOPED_PROFILING_EVENT_CL("ClReshapeWorkload_Execute");
Aron Virginas-Tara8e06ed2018-10-19 16:46:15 +010038 RunClFunction(m_Layer, CHECK_LOCATION());
Nattapat Chaimanowonga76698c2018-10-11 10:29:15 +010039}
40
41} //namespace armnn