blob: 3ec0c7a5cfb7ec8851caae2cf748cc89bc106027 [file] [log] [blame]
Anthony Barbier2a07e182017-08-04 18:20:27 +01001/*
Alex Gilday7bfb1992018-02-15 11:07:18 +00002 * Copyright (c) 2017-2018 ARM Limited.
Anthony Barbier2a07e182017-08-04 18:20:27 +01003 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24#ifndef __ARM_COMPUTE_GRAPH_TYPES_H__
25#define __ARM_COMPUTE_GRAPH_TYPES_H__
26
27#include "arm_compute/core/ITensor.h"
Georgios Pinitas6f669f02017-09-26 12:32:57 +010028#include "arm_compute/core/SubTensorInfo.h"
Anthony Barbier2a07e182017-08-04 18:20:27 +010029#include "arm_compute/core/TensorInfo.h"
Georgios Pinitas7d3d1b92017-10-12 17:34:20 +010030#include "arm_compute/core/utils/logging/Macros.h"
31
Georgios Pinitas3faea252017-10-30 14:13:50 +000032/** Create a default core logger
33 *
34 * @note It will eventually create all default loggers in don't exist
35 */
36#define ARM_COMPUTE_CREATE_DEFAULT_GRAPH_LOGGER() \
37 do \
38 { \
39 if(arm_compute::logging::LoggerRegistry::get().logger("GRAPH") == nullptr) \
40 { \
41 arm_compute::logging::LoggerRegistry::get().create_reserved_loggers(); \
42 } \
43 } while(false)
44
45#define ARM_COMPUTE_LOG_GRAPH(log_level, x) \
46 ARM_COMPUTE_CREATE_DEFAULT_GRAPH_LOGGER(); \
Georgios Pinitas7d3d1b92017-10-12 17:34:20 +010047 ARM_COMPUTE_LOG_STREAM("GRAPH", log_level, x)
48
Georgios Pinitas3faea252017-10-30 14:13:50 +000049#define ARM_COMPUTE_LOG_GRAPH_INFO(x) \
50 ARM_COMPUTE_CREATE_DEFAULT_GRAPH_LOGGER(); \
Georgios Pinitas7d3d1b92017-10-12 17:34:20 +010051 ARM_COMPUTE_LOG_STREAM("GRAPH", arm_compute::logging::LogLevel::INFO, x)
Anthony Barbier2a07e182017-08-04 18:20:27 +010052
53namespace arm_compute
54{
55namespace graph
56{
Georgios Pinitas6f669f02017-09-26 12:32:57 +010057using arm_compute::ActivationLayerInfo;
Georgios Pinitase2c82fe2017-10-02 18:51:47 +010058using arm_compute::Coordinates;
59using arm_compute::DataType;
60using arm_compute::DimensionRoundingType;
61using arm_compute::ITensorInfo;
Georgios Pinitas6f669f02017-09-26 12:32:57 +010062using arm_compute::NormType;
63using arm_compute::NormalizationLayerInfo;
Georgios Pinitase2c82fe2017-10-02 18:51:47 +010064using arm_compute::PadStrideInfo;
Anthony Barbier2a07e182017-08-04 18:20:27 +010065using arm_compute::PoolingLayerInfo;
66using arm_compute::PoolingType;
Georgios Pinitase2c82fe2017-10-02 18:51:47 +010067using arm_compute::SubTensorInfo;
68using arm_compute::TensorInfo;
69using arm_compute::TensorShape;
70using arm_compute::WeightsInfo;
Anthony Barbier2a07e182017-08-04 18:20:27 +010071
Georgios Pinitas7d3d1b92017-10-12 17:34:20 +010072using arm_compute::logging::LogLevel;
Michalis Spyrou27c9efb2017-10-09 15:46:30 +010073using arm_compute::ConvertPolicy;
Georgios Pinitas7d3d1b92017-10-12 17:34:20 +010074
Anthony Barbier2a07e182017-08-04 18:20:27 +010075/**< Execution hint to the graph executor */
Georgios Pinitasff421f22017-10-04 16:53:58 +010076enum class TargetHint
Anthony Barbier2a07e182017-08-04 18:20:27 +010077{
78 DONT_CARE, /**< Run node in any device */
79 OPENCL, /**< Run node on an OpenCL capable device (GPU) */
80 NEON /**< Run node on a NEON capable device */
81};
82
Georgios Pinitase2c82fe2017-10-02 18:51:47 +010083/** Convolution method hint to the graph executor */
Georgios Pinitas6f669f02017-09-26 12:32:57 +010084enum class ConvolutionMethodHint
85{
86 GEMM, /**< Convolution using GEMM */
87 DIRECT /**< Direct convolution */
88};
Georgios Pinitase2c82fe2017-10-02 18:51:47 +010089
Georgios Pinitas407c3e62017-10-25 18:26:46 +010090/** Supported layer operations */
91enum class OperationType
92{
93 ActivationLayer,
94 BatchNormalizationLayer,
95 ConvolutionLayer,
Michalis Spyrou27c9efb2017-10-09 15:46:30 +010096 DepthConvertLayer,
Michalis Spyrou7bfe4c52017-11-24 09:54:20 +000097 DepthwiseConvolutionLayer,
Michalis Spyrou27c9efb2017-10-09 15:46:30 +010098 DequantizationLayer,
99 FlattenLayer,
Georgios Pinitas407c3e62017-10-25 18:26:46 +0100100 FloorLayer,
101 FullyConnectedLayer,
102 L2NormalizeLayer,
103 NormalizationLayer,
104 PoolingLayer,
Michalis Spyrou27c9efb2017-10-09 15:46:30 +0100105 QuantizationLayer,
106 ReshapeLayer,
Georgios Pinitas407c3e62017-10-25 18:26:46 +0100107 SoftmaxLayer
108};
109
Georgios Pinitase2c82fe2017-10-02 18:51:47 +0100110/** Branch layer merging method */
111enum class BranchMergeMethod
112{
113 DEPTH_CONCATENATE /**< Concatenate across depth */
114};
Anthony Barbier2a07e182017-08-04 18:20:27 +0100115} // namespace graph
116} // namespace arm_compute
117#endif /*__ARM_COMPUTE_GRAPH_TYPES_H__*/