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>
25
26#include "ir/Layout.h"
27#include "ir/InternalType.h"
28#include "ir/Operand.h"
29#include "ir/operation/Pool2D.h"
30#include "ir/operation/Reduce.h"
32#include "ir/Shape.h"
33#include "ir/TypeInfo.h"
34#include "ir/Coordinates.h"
35#include "ir/Padding.h"
36#include "misc/feature/Shape.h"
37#include "misc/kernel/Shape.h"
38
39#include "AclFunction.h"
40
41#include <set>
42
43namespace onert
44{
45namespace backend
46{
47namespace acl_common
48{
49
50::arm_compute::TensorShape asTensorShape(const ir::Shape &shape, bool apply_dim_correction = true);
51::arm_compute::Coordinates asTensorCoordinate(const ir::Coordinates &coord);
52::arm_compute::DataType asDataType(ir::DataType type);
53::arm_compute::TensorInfo asTensorInfo(const ir::Shape &shape, const ir::TypeInfo &typeInfo,
54 bool apply_dim_correction = true);
55
56::arm_compute::PadStrideInfo asPadStrideInfo(const ir::ExplicitPadding &padding,
57 const ir::Stride &stride);
58
59::arm_compute::ActivationLayerInfo asActivationLayerInfo(ir::Activation act_code);
60::arm_compute::ActivationLayerInfo
62 float beta);
63
64arm_compute::Coordinates asCoordinates(const ir::Operand &operand, int32_t rank);
65
66std::set<uint32_t> asSet(const ir::Operand &operand, int32_t rank);
67
68std::unique_ptr<AclFunction> asAclFunction(std::unique_ptr<::arm_compute::IFunction> &&layer);
69
70template <typename T_Function>
71std::unique_ptr<T_Function> asFunction(std::unique_ptr<::arm_compute::IFunction> &&fn)
72{
73 return std::make_unique<T_Function>(std::move(fn));
74}
75
76ir::DataType asRuntimeDataType(::arm_compute::DataType data_type);
77
78arm_compute::PoolingType convertPoolType(ir::operation::Pool2D::PoolType pool_type_ir);
79arm_compute::ReductionOperation convertReduceType(ir::operation::Reduce::ReduceType reduce_type_ir);
80
81arm_compute::PixelValue asPixelValue(const ir::Operand &operand);
82arm_compute::Size2D asDilation(uint32_t dilation_width, uint32_t dilation_height);
83
84} // namespace acl_common
85} // namespace backend
86} // namespace onert
87
88#endif // __ONERT_BACKEND_ACL_COMMON_CONVERT_H__
arm_compute::PoolingType convertPoolType(ir::operation::Pool2D::PoolType pool_type_ir)
Definition Convert.cc:283
::arm_compute::Coordinates asTensorCoordinate(const ir::Coordinates &coord)
Definition Convert.cc:59
std::set< uint32_t > asSet(const ir::Operand &operand, int32_t rank)
Definition Convert.cc:224
::arm_compute::ActivationLayerInfo asActivationLayerInfo(const ir::Activation act_code)
Definition Convert.cc:135
arm_compute::ReductionOperation convertReduceType(ir::operation::Reduce::ReduceType reduce_type_ir)
Definition Convert.cc:298
arm_compute::Coordinates asCoordinates(const ir::Operand &operand, int32_t rank)
Definition Convert.cc:211
arm_compute::PixelValue asPixelValue(const ir::Operand &operand)
Definition Convert.cc:313
arm_compute::Size2D asDilation(uint32_t dilation_width, uint32_t dilation_height)
Definition Convert.cc:334
::arm_compute::PadStrideInfo asPadStrideInfo(const ir::ExplicitPadding &padding, const ir::Stride &stride)
Definition Convert.cc:123
std::unique_ptr< AclFunction > asAclFunction(std::unique_ptr<::arm_compute::IFunction > &&layer)
Definition Convert.cc:250
std::unique_ptr< T_Function > asFunction(std::unique_ptr<::arm_compute::IFunction > &&fn)
Definition Convert.h:71
::arm_compute::TensorShape asTensorShape(const ir::Shape &shape, bool apply_dim_correction)
Definition Convert.cc:31
::arm_compute::TensorInfo asTensorInfo(const ir::Shape &shape, const ir::TypeInfo &typeInfo, bool apply_dim_correction)
Definition Convert.cc:113
::arm_compute::DataType asDataType(const ir::DataType type)
Definition Convert.cc:75
ir::DataType asRuntimeDataType(::arm_compute::DataType data_type)
Definition Convert.cc:255
This file contains Shape class for feature.
This file contains Shape structure.