aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/graph2
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute/graph2')
-rw-r--r--arm_compute/graph2/GraphContext.h4
-rw-r--r--arm_compute/graph2/INodeVisitor.h100
-rw-r--r--arm_compute/graph2/TensorDescriptor.h6
-rw-r--r--arm_compute/graph2/Types.h8
-rw-r--r--arm_compute/graph2/backends/NEON/NEFunctionFactory.h1
-rw-r--r--arm_compute/graph2/frontend/ILayer.h11
-rw-r--r--arm_compute/graph2/frontend/Layers.h66
-rw-r--r--arm_compute/graph2/nodes/ActivationLayerNode.h1
-rw-r--r--arm_compute/graph2/nodes/BatchNormalizationLayerNode.h1
-rw-r--r--arm_compute/graph2/nodes/ConstNode.h1
-rw-r--r--arm_compute/graph2/nodes/ConvolutionLayerNode.h1
-rw-r--r--arm_compute/graph2/nodes/DepthConcatenateLayerNode.h1
-rw-r--r--arm_compute/graph2/nodes/DepthwiseConvolutionLayerNode.h1
-rw-r--r--arm_compute/graph2/nodes/EltwiseLayerNode.h1
-rw-r--r--arm_compute/graph2/nodes/FlattenLayerNode.h1
-rw-r--r--arm_compute/graph2/nodes/FullyConnectedLayerNode.h1
-rw-r--r--arm_compute/graph2/nodes/InputNode.h1
-rw-r--r--arm_compute/graph2/nodes/NormalizationLayerNode.h1
-rw-r--r--arm_compute/graph2/nodes/OutputNode.h1
-rw-r--r--arm_compute/graph2/nodes/PoolingLayerNode.h1
-rw-r--r--arm_compute/graph2/nodes/ReshapeLayerNode.h1
-rw-r--r--arm_compute/graph2/nodes/SoftmaxLayerNode.h1
-rw-r--r--arm_compute/graph2/printers/DotGraphPrinter.h1
23 files changed, 183 insertions, 29 deletions
diff --git a/arm_compute/graph2/GraphContext.h b/arm_compute/graph2/GraphContext.h
index bd579eaca2..72ed96e7a0 100644
--- a/arm_compute/graph2/GraphContext.h
+++ b/arm_compute/graph2/GraphContext.h
@@ -38,8 +38,8 @@ namespace graph2
/** Contains structs required for memory management */
struct MemoryManagerContext
{
- Target target = { Target::UNSPECIFIED };
- std::shared_ptr<arm_compute::IMemoryManager> mm = { nullptr };
+ Target target = { Target::UNSPECIFIED }; /**< Target */
+ std::shared_ptr<arm_compute::IMemoryManager> mm = { nullptr }; /**< Memory manager */
};
/** Graph context **/
diff --git a/arm_compute/graph2/INodeVisitor.h b/arm_compute/graph2/INodeVisitor.h
index 429a2584bb..a7b8aeb45d 100644
--- a/arm_compute/graph2/INodeVisitor.h
+++ b/arm_compute/graph2/INodeVisitor.h
@@ -34,23 +34,88 @@ namespace graph2
class INodeVisitor
{
public:
- virtual ~INodeVisitor() = default;
- virtual void visit(INode &n) = 0;
- virtual void visit(ActivationLayerNode &n) = 0;
- virtual void visit(BatchNormalizationLayerNode &n) = 0;
- virtual void visit(ConstNode &n) = 0;
- virtual void visit(ConvolutionLayerNode &n) = 0;
- virtual void visit(DepthConcatenateLayerNode &n) = 0;
+ /** Default destructor. */
+ virtual ~INodeVisitor() = default;
+ /** Visit INode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(INode &n) = 0;
+ /** Visit ActivationLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(ActivationLayerNode &n) = 0;
+ /** Visit BatchNormalizationLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(BatchNormalizationLayerNode &n) = 0;
+ /** Visit ConstNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(ConstNode &n) = 0;
+ /** Visit ConvolutionLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(ConvolutionLayerNode &n) = 0;
+ /** Visit DepthConcatenateLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(DepthConcatenateLayerNode &n) = 0;
+ /** Visit DepthwiseConvolutionLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
virtual void visit(DepthwiseConvolutionLayerNode &n) = 0;
- virtual void visit(EltwiseLayerNode &n) = 0;
- virtual void visit(FlattenLayerNode &n) = 0;
- virtual void visit(FullyConnectedLayerNode &n) = 0;
- virtual void visit(InputNode &n) = 0;
- virtual void visit(NormalizationLayerNode &n) = 0;
- virtual void visit(OutputNode &n) = 0;
- virtual void visit(PoolingLayerNode &n) = 0;
- virtual void visit(ReshapeLayerNode &n) = 0;
- virtual void visit(SoftmaxLayerNode &n) = 0;
+ /** Visit EltwiseLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(EltwiseLayerNode &n) = 0;
+ /** Visit FlattenLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(FlattenLayerNode &n) = 0;
+ /** Visit FullyConnectedLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(FullyConnectedLayerNode &n) = 0;
+ /** Visit InputNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(InputNode &n) = 0;
+ /** Visit NormalizationLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(NormalizationLayerNode &n) = 0;
+ /** Visit OutputNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(OutputNode &n) = 0;
+ /** Visit PoolingLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(PoolingLayerNode &n) = 0;
+ /** Visit ReshapeLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(ReshapeLayerNode &n) = 0;
+ /** Visit SoftmaxLayerNode.
+ *
+ * @param[in] n Node to visit.
+ */
+ virtual void visit(SoftmaxLayerNode &n) = 0;
};
/** Default visitor implementation
@@ -61,8 +126,10 @@ public:
class DefaultNodeVisitor : public INodeVisitor
{
public:
+ /** Default destructor */
virtual ~DefaultNodeVisitor() = default;
+#ifndef DOXYGEN_SKIP_THIS
// Inherited methods overridden
virtual void visit(INode &n) override
{
@@ -128,6 +195,7 @@ public:
{
default_visit();
}
+#endif /* DOXYGEN_SKIP_THIS */
/** Function to be overloaded by the client and implement default behavior for the
* non-overloaded visitors
diff --git a/arm_compute/graph2/TensorDescriptor.h b/arm_compute/graph2/TensorDescriptor.h
index ff23f71471..1a69dc10e8 100644
--- a/arm_compute/graph2/TensorDescriptor.h
+++ b/arm_compute/graph2/TensorDescriptor.h
@@ -46,9 +46,9 @@ struct TensorDescriptor final
{
}
- TensorShape shape{};
- DataType data_type{ DataType::UNKNOWN };
- Target target{ Target::UNSPECIFIED };
+ TensorShape shape{}; /**< Tensor shape */
+ DataType data_type{ DataType::UNKNOWN }; /**< Data type */
+ Target target{ Target::UNSPECIFIED }; /**< Target */
};
} // namespace graph2
} // namespace arm_compute
diff --git a/arm_compute/graph2/Types.h b/arm_compute/graph2/Types.h
index 05c15f4daf..2e9fe38380 100644
--- a/arm_compute/graph2/Types.h
+++ b/arm_compute/graph2/Types.h
@@ -144,15 +144,15 @@ enum class MemoryManagerAffinity
*/
struct NodeIdxPair
{
- NodeID node_id;
- size_t index;
+ NodeID node_id; /**< Node ID */
+ size_t index; /**< Index */
};
/** Common node parameters */
struct NodeParams
{
- std::string name;
- Target target;
+ std::string name; /**< Node name */
+ Target target; /**< Node target */
};
} // namespace graph2
} // namespace arm_compute
diff --git a/arm_compute/graph2/backends/NEON/NEFunctionFactory.h b/arm_compute/graph2/backends/NEON/NEFunctionFactory.h
index a065340ad6..09ca49ae6c 100644
--- a/arm_compute/graph2/backends/NEON/NEFunctionFactory.h
+++ b/arm_compute/graph2/backends/NEON/NEFunctionFactory.h
@@ -38,6 +38,7 @@ class GraphContext;
namespace backends
{
+/** Factory for generating NEON backend functions **/
class NEFunctionFactory final
{
public:
diff --git a/arm_compute/graph2/frontend/ILayer.h b/arm_compute/graph2/frontend/ILayer.h
index fee0b37e64..f8f6a5d47e 100644
--- a/arm_compute/graph2/frontend/ILayer.h
+++ b/arm_compute/graph2/frontend/ILayer.h
@@ -33,11 +33,18 @@ namespace frontend
// Forward declarations
class IStream;
-/** ILayer interface **/
+/** ILayer interface */
class ILayer
{
public:
- virtual ~ILayer() = default;
+ /** Default destructor */
+ virtual ~ILayer() = default;
+ /** Create layer and add to the given stream.
+ *
+ * @param[in] s Stream to add layer to.
+ *
+ * @return ID of the created node.
+ */
virtual NodeID create_layer(IStream &s) = 0;
};
} // namespace frontend
diff --git a/arm_compute/graph2/frontend/Layers.h b/arm_compute/graph2/frontend/Layers.h
index 40274a4769..7ea23e0684 100644
--- a/arm_compute/graph2/frontend/Layers.h
+++ b/arm_compute/graph2/frontend/Layers.h
@@ -45,6 +45,11 @@ namespace frontend
class InputLayer final : public ILayer
{
public:
+ /** Construct an input layer.
+ *
+ * @param[in] desc Description of input tensor.
+ * @param[in] accessor Accessor to get input tensor data from.
+ */
InputLayer(TensorDescriptor desc, ITensorAccessorUPtr accessor)
: _desc(desc), _accessor(std::move(accessor))
{
@@ -65,6 +70,10 @@ private:
class OutputLayer final : public ILayer
{
public:
+ /** Construct an output layer.
+ *
+ * @param[in] accessor Accessor to give output tensor data to.
+ */
OutputLayer(ITensorAccessorUPtr accessor)
: _accessor(std::move(accessor))
{
@@ -85,6 +94,10 @@ private:
class ActivationLayer final : public ILayer
{
public:
+ /** Construct an activation layer.
+ *
+ * @param[in] act_info Activation information
+ */
ActivationLayer(ActivationLayerInfo act_info)
: _act_info(act_info)
{
@@ -105,6 +118,14 @@ private:
class BatchNormalizationLayer final : public ILayer
{
public:
+ /** Construct a batch normalization layer.
+ *
+ * @param[in] mean Accessor to get mean tensor data from.
+ * @param[in] var Accessor to get var tensor data from.
+ * @param[in] gamma (Optional) Accessor to get gamma tensor data from. Default: nullptr.
+ * @param[in] beta (Optional) Accessor to get beta tensor data from. Default: nullptr.
+ * @param[in] epsilon (Optional) Epsilon value. Default: 0.001.
+ */
BatchNormalizationLayer(ITensorAccessorUPtr mean,
ITensorAccessorUPtr var,
ITensorAccessorUPtr gamma = nullptr,
@@ -137,6 +158,16 @@ private:
class ConvolutionLayer final : public ILayer
{
public:
+ /** Construct a convolution layer.
+ *
+ * @param[in] conv_width Convolution width.
+ * @param[in] conv_height Convolution height.
+ * @param[in] ofm Output feature map.
+ * @param[in] weights Accessor to get kernel weights from.
+ * @param[in] bias Accessor to get kernel bias from.
+ * @param[in] conv_info Padding and stride information.
+ * @param[in] num_groups (Optional) Number of groups. Default: 1.
+ */
ConvolutionLayer(unsigned int conv_width,
unsigned int conv_height,
unsigned int ofm,
@@ -179,6 +210,14 @@ private:
class DepthwiseConvolutionLayer final : public ILayer
{
public:
+ /** Construct a depthwise convolution layer.
+ *
+ * @param[in] conv_width Convolution width.
+ * @param[in] conv_height Convolution height.
+ * @param[in] weights Accessor to get kernel weights from.
+ * @param[in] bias Accessor to get kernel bias from.
+ * @param[in] conv_info Padding and stride information.
+ */
DepthwiseConvolutionLayer(unsigned int conv_width,
unsigned int conv_height,
ITensorAccessorUPtr weights,
@@ -214,6 +253,7 @@ private:
class FlattenLayer final : public ILayer
{
public:
+ /** Construct a flatten layer. */
FlattenLayer()
{
}
@@ -230,6 +270,12 @@ public:
class FullyConnectedLayer final : public ILayer
{
public:
+ /** Construct a fully connected layer.
+ *
+ * @param[in] num_outputs Number of outputs.
+ * @param[in] weights Accessor to get weights from.
+ * @param[in] bias Accessor to get bias from.
+ */
FullyConnectedLayer(unsigned int num_outputs,
ITensorAccessorUPtr weights,
ITensorAccessorUPtr bias)
@@ -255,6 +301,10 @@ private:
class NormalizationLayer final : public ILayer
{
public:
+ /** Construct a normalization layer.
+ *
+ * @param[in] norm_info Normalization information.
+ */
NormalizationLayer(NormalizationLayerInfo norm_info)
: _norm_info(norm_info)
{
@@ -275,6 +325,10 @@ private:
class PoolingLayer final : public ILayer
{
public:
+ /** Construct a pooling layer.
+ *
+ * @param[in] pool_info Pooling information.
+ */
PoolingLayer(PoolingLayerInfo pool_info)
: _pool_info(pool_info)
{
@@ -295,6 +349,10 @@ private:
class ReshapeLayer final : public ILayer
{
public:
+ /** Construct a reshape layer.
+ *
+ * @param[in] shape Target shape.
+ */
ReshapeLayer(TensorShape shape)
: _shape(shape)
{
@@ -315,6 +373,10 @@ private:
class SoftmaxLayer final : public ILayer
{
public:
+ /** Construct a softmax layer.
+ *
+ * @param[in] beta (Optional) Beta value. Default 1.0.
+ */
SoftmaxLayer(float beta = 1.0f)
: _beta(beta)
{
@@ -335,7 +397,7 @@ private:
class BranchLayer final : public ILayer
{
public:
- /** Default Constructor
+ /** Construct a branch layer
*
* @param[in] merge_method Branch merging method
* @param[in] sub_stream1 First graph branch
@@ -355,7 +417,7 @@ public:
},
std::move(rest_sub_streams)...);
}
- /** Default Constructor
+ /** Construct a branch layer
*
* @param[in] sub_stream Sub-stream
*/
diff --git a/arm_compute/graph2/nodes/ActivationLayerNode.h b/arm_compute/graph2/nodes/ActivationLayerNode.h
index c3775231a4..cb19c818c5 100644
--- a/arm_compute/graph2/nodes/ActivationLayerNode.h
+++ b/arm_compute/graph2/nodes/ActivationLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Activation Layer node */
class ActivationLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/BatchNormalizationLayerNode.h b/arm_compute/graph2/nodes/BatchNormalizationLayerNode.h
index a521938414..a6e8e2b98e 100644
--- a/arm_compute/graph2/nodes/BatchNormalizationLayerNode.h
+++ b/arm_compute/graph2/nodes/BatchNormalizationLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Batch Normalization Layer node */
class BatchNormalizationLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/ConstNode.h b/arm_compute/graph2/nodes/ConstNode.h
index 73a2246498..e1c66176f0 100644
--- a/arm_compute/graph2/nodes/ConstNode.h
+++ b/arm_compute/graph2/nodes/ConstNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Const node */
class ConstNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/ConvolutionLayerNode.h b/arm_compute/graph2/nodes/ConvolutionLayerNode.h
index 1af344ea13..6e3c9bef32 100644
--- a/arm_compute/graph2/nodes/ConvolutionLayerNode.h
+++ b/arm_compute/graph2/nodes/ConvolutionLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Convolution Layer node */
class ConvolutionLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/DepthConcatenateLayerNode.h b/arm_compute/graph2/nodes/DepthConcatenateLayerNode.h
index 617b9842fb..23c31048e9 100644
--- a/arm_compute/graph2/nodes/DepthConcatenateLayerNode.h
+++ b/arm_compute/graph2/nodes/DepthConcatenateLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Depth Concatenation Layer node */
class DepthConcatenateLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/DepthwiseConvolutionLayerNode.h b/arm_compute/graph2/nodes/DepthwiseConvolutionLayerNode.h
index 1b05edf4dc..d5b8e34554 100644
--- a/arm_compute/graph2/nodes/DepthwiseConvolutionLayerNode.h
+++ b/arm_compute/graph2/nodes/DepthwiseConvolutionLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Depthwise Convolution Layer node */
class DepthwiseConvolutionLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/EltwiseLayerNode.h b/arm_compute/graph2/nodes/EltwiseLayerNode.h
index 2b217decff..48df2b715d 100644
--- a/arm_compute/graph2/nodes/EltwiseLayerNode.h
+++ b/arm_compute/graph2/nodes/EltwiseLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Eltwise Layer node */
class EltwiseLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/FlattenLayerNode.h b/arm_compute/graph2/nodes/FlattenLayerNode.h
index de601f5f4e..41f6f85045 100644
--- a/arm_compute/graph2/nodes/FlattenLayerNode.h
+++ b/arm_compute/graph2/nodes/FlattenLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Flatten Layer node */
class FlattenLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/FullyConnectedLayerNode.h b/arm_compute/graph2/nodes/FullyConnectedLayerNode.h
index 836f20fdb3..5c71f4ca69 100644
--- a/arm_compute/graph2/nodes/FullyConnectedLayerNode.h
+++ b/arm_compute/graph2/nodes/FullyConnectedLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Fully Connected Layer node */
class FullyConnectedLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/InputNode.h b/arm_compute/graph2/nodes/InputNode.h
index 2cad6f8fc6..667dcfacf0 100644
--- a/arm_compute/graph2/nodes/InputNode.h
+++ b/arm_compute/graph2/nodes/InputNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Input Layer node */
class InputNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/NormalizationLayerNode.h b/arm_compute/graph2/nodes/NormalizationLayerNode.h
index e2816e9352..78a843a1e7 100644
--- a/arm_compute/graph2/nodes/NormalizationLayerNode.h
+++ b/arm_compute/graph2/nodes/NormalizationLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Normalization Layer node */
class NormalizationLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/OutputNode.h b/arm_compute/graph2/nodes/OutputNode.h
index 94df382d22..0c28c84214 100644
--- a/arm_compute/graph2/nodes/OutputNode.h
+++ b/arm_compute/graph2/nodes/OutputNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Output Layer node */
class OutputNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/PoolingLayerNode.h b/arm_compute/graph2/nodes/PoolingLayerNode.h
index b0c6270999..09332a9367 100644
--- a/arm_compute/graph2/nodes/PoolingLayerNode.h
+++ b/arm_compute/graph2/nodes/PoolingLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Pooling Layer node */
class PoolingLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/ReshapeLayerNode.h b/arm_compute/graph2/nodes/ReshapeLayerNode.h
index 89ee46c8e1..27d52601da 100644
--- a/arm_compute/graph2/nodes/ReshapeLayerNode.h
+++ b/arm_compute/graph2/nodes/ReshapeLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Reshape Layer node */
class ReshapeLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/nodes/SoftmaxLayerNode.h b/arm_compute/graph2/nodes/SoftmaxLayerNode.h
index 86decb80d9..b1091e28fc 100644
--- a/arm_compute/graph2/nodes/SoftmaxLayerNode.h
+++ b/arm_compute/graph2/nodes/SoftmaxLayerNode.h
@@ -30,6 +30,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Softmax Layer node */
class SoftmaxLayerNode final : public INode
{
public:
diff --git a/arm_compute/graph2/printers/DotGraphPrinter.h b/arm_compute/graph2/printers/DotGraphPrinter.h
index 3b1879c505..0efdf772e3 100644
--- a/arm_compute/graph2/printers/DotGraphPrinter.h
+++ b/arm_compute/graph2/printers/DotGraphPrinter.h
@@ -34,6 +34,7 @@ namespace arm_compute
{
namespace graph2
{
+/** Graph printer visitor. */
class DotGraphVisitor final : public DefaultNodeVisitor
{
public: