ArmNN
 25.11
Loading...
Searching...
No Matches
ClQuantizeWorkload.cpp
Go to the documentation of this file.
1//
2// Copyright © 2019-2023 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
7#include "ClWorkloadUtils.hpp"
8
11
13
14#include <cl/ClLayerSupport.hpp>
15#include <cl/ClTensorHandle.hpp>
16#include <cl/ClLayerSupport.hpp>
17
18namespace armnn
19{
20using namespace armcomputetensorutils;
21
22arm_compute::Status ClQuantizeWorkloadValidate(const TensorInfo& input,
23 const TensorInfo& output)
24{
25 const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input);
26 const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output);
27
28 return arm_compute::CLQuantizationLayer::validate(&aclInputInfo,
29 &aclOutputInfo);
30}
31
33 const WorkloadInfo& info,
34 const arm_compute::CLCompileContext& clCompileContext)
36{
37 m_Data.ValidateInputsOutputs("ClQuantizeWorkload", 1, 1);
38
39 arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
40 arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
41
42 {
43 ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClQuantizeWorkload_configure");
44 m_Layer.configure(clCompileContext, &input, &output);
45 }
46}
47
49{
50 ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClQuantizeWorkload_Execute");
51 RunClFunction(m_Layer, CHECK_LOCATION());
52}
53
54} //namespace armnn
#define ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
#define CHECK_LOCATION()
ClBaseWorkload(const QuantizeQueueDescriptor &descriptor, const WorkloadInfo &info)
ClQuantizeWorkload(const QuantizeQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
void Execute() const override
virtual arm_compute::ICLTensor & GetTensor()=0
Copyright (c) 2021 ARM Limited and Contributors.
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
arm_compute::Status ClQuantizeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
Contains information about TensorInfos of a layer.