ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Convert.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __ONERT_BACKEND_ACL_COMMON_CONVERT_H__
18#define __ONERT_BACKEND_ACL_COMMON_CONVERT_H__
19
20#include <arm_compute/core/PixelValue.h>
21#include <arm_compute/core/TensorInfo.h>
22#include <arm_compute/core/SubTensorInfo.h>
23#include <arm_compute/core/TensorShape.h>
24
25#include "ir/Layout.h"
26#include "ir/InternalType.h"
27#include "ir/Operand.h"
28#include "ir/operation/Pool2D.h"
29#include "ir/operation/Reduce.h"
31#include "ir/Shape.h"
32#include "ir/TypeInfo.h"
33#include "ir/Coordinates.h"
34#include "ir/Padding.h"
35
36#include "AclFunction.h"
37
38#include <set>
39
41{
42
43::arm_compute::TensorShape asTensorShape(const ir::Shape &shape, bool apply_dim_correction = true);
44::arm_compute::Coordinates asTensorCoordinate(const ir::Coordinates &coord);
45::arm_compute::DataType asDataType(ir::DataType type);
46::arm_compute::TensorInfo asTensorInfo(const ir::Shape &shape, const ir::TypeInfo &typeInfo,
47 bool apply_dim_correction = true);
48
49::arm_compute::PadStrideInfo asPadStrideInfo(const ir::ExplicitPadding &padding,
50 const ir::Stride &stride);
51
52::arm_compute::ActivationLayerInfo asActivationLayerInfo(ir::Activation act_code);
53::arm_compute::ActivationLayerInfo
55 float beta);
56
57arm_compute::Coordinates asCoordinates(const ir::Operand &operand, int32_t rank);
58
59std::set<uint32_t> asSet(const ir::Operand &operand, int32_t rank);
60
61std::unique_ptr<AclFunction> asAclFunction(std::unique_ptr<::arm_compute::IFunction> &&layer);
62
63template <typename T_Function>
64std::unique_ptr<T_Function> asFunction(std::unique_ptr<::arm_compute::IFunction> &&fn)
65{
66 return std::make_unique<T_Function>(std::move(fn));
67}
68
69ir::DataType asRuntimeDataType(::arm_compute::DataType data_type);
70
71arm_compute::PoolingType convertPoolType(ir::operation::Pool2D::PoolType pool_type_ir);
72arm_compute::ReductionOperation convertReduceType(ir::operation::Reduce::ReduceType reduce_type_ir);
73
74arm_compute::PixelValue asPixelValue(const ir::Operand &operand);
75arm_compute::Size2D asDilation(uint32_t dilation_width, uint32_t dilation_height);
76
77} // namespace onert::backend::acl_common
78
79#endif // __ONERT_BACKEND_ACL_COMMON_CONVERT_H__
int32_t type
arm_compute::PoolingType convertPoolType(ir::operation::Pool2D::PoolType pool_type_ir)
Definition Convert.cc:281
::arm_compute::Coordinates asTensorCoordinate(const ir::Coordinates &coord)
Definition Convert.cc:55
std::set< uint32_t > asSet(const ir::Operand &operand, int32_t rank)
Definition Convert.cc:220
::arm_compute::ActivationLayerInfo asActivationLayerInfo(const ir::Activation act_code)
Definition Convert.cc:131
arm_compute::ReductionOperation convertReduceType(ir::operation::Reduce::ReduceType reduce_type_ir)
Definition Convert.cc:296
arm_compute::Coordinates asCoordinates(const ir::Operand &operand, int32_t rank)
Definition Convert.cc:207
arm_compute::PixelValue asPixelValue(const ir::Operand &operand)
Definition Convert.cc:311
arm_compute::Size2D asDilation(uint32_t dilation_width, uint32_t dilation_height)
Definition Convert.cc:332
::arm_compute::PadStrideInfo asPadStrideInfo(const ir::ExplicitPadding &padding, const ir::Stride &stride)
Definition Convert.cc:119
std::unique_ptr< AclFunction > asAclFunction(std::unique_ptr<::arm_compute::IFunction > &&layer)
Definition Convert.cc:246
std::unique_ptr< T_Function > asFunction(std::unique_ptr<::arm_compute::IFunction > &&fn)
Definition Convert.h:64
::arm_compute::TensorShape asTensorShape(const ir::Shape &shape, bool apply_dim_correction)
Definition Convert.cc:27
::arm_compute::TensorInfo asTensorInfo(const ir::Shape &shape, const ir::TypeInfo &typeInfo, bool apply_dim_correction)
Definition Convert.cc:109
::arm_compute::DataType asDataType(const ir::DataType type)
Definition Convert.cc:71
ir::DataType asRuntimeDataType(::arm_compute::DataType data_type)
Definition Convert.cc:251