ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
44{
45
46::arm_compute::TensorShape asTensorShape(const ir::Shape &shape, bool apply_dim_correction = true);
47::arm_compute::Coordinates asTensorCoordinate(const ir::Coordinates &coord);
48::arm_compute::DataType asDataType(ir::DataType type);
49::arm_compute::TensorInfo asTensorInfo(const ir::Shape &shape, const ir::TypeInfo &typeInfo,
50 bool apply_dim_correction = true);
51
52::arm_compute::PadStrideInfo asPadStrideInfo(const ir::ExplicitPadding &padding,
53 const ir::Stride &stride);
54
55::arm_compute::ActivationLayerInfo asActivationLayerInfo(ir::Activation act_code);
56::arm_compute::ActivationLayerInfo
58 float beta);
59
60arm_compute::Coordinates asCoordinates(const ir::Operand &operand, int32_t rank);
61
62std::set<uint32_t> asSet(const ir::Operand &operand, int32_t rank);
63
64std::unique_ptr<AclFunction> asAclFunction(std::unique_ptr<::arm_compute::IFunction> &&layer);
65
66template <typename T_Function>
67std::unique_ptr<T_Function> asFunction(std::unique_ptr<::arm_compute::IFunction> &&fn)
68{
69 return std::make_unique<T_Function>(std::move(fn));
70}
71
72ir::DataType asRuntimeDataType(::arm_compute::DataType data_type);
73
74arm_compute::PoolingType convertPoolType(ir::operation::Pool2D::PoolType pool_type_ir);
75arm_compute::ReductionOperation convertReduceType(ir::operation::Reduce::ReduceType reduce_type_ir);
76
77arm_compute::PixelValue asPixelValue(const ir::Operand &operand);
78arm_compute::Size2D asDilation(uint32_t dilation_width, uint32_t dilation_height);
79
80} // namespace onert::backend::acl_common
81
82#endif // __ONERT_BACKEND_ACL_COMMON_CONVERT_H__
arm_compute::PoolingType convertPoolType(ir::operation::Pool2D::PoolType pool_type_ir)
Definition Convert.cc:279
::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:294
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:309
arm_compute::Size2D asDilation(uint32_t dilation_width, uint32_t dilation_height)
Definition Convert.cc:330
::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:67
::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
This file contains Shape class for feature.
This file contains Shape structure.