aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/graph/LayerDescriptors.h
diff options
context:
space:
mode:
authorSang-Hoon Park <sang-hoon.park@arm.com>2020-03-11 23:21:14 +0000
committerMichele Di Giorgio <michele.digiorgio@arm.com>2020-03-13 08:33:24 +0000
commit797b76b1aef38ea3be6f68ae2bf323048e9beff8 (patch)
treef78bb65ef0fe49bbb7d06225a4e7e4f2cc43cb45 /arm_compute/graph/LayerDescriptors.h
parent470bc1eea65560d13001e60a7f7b22b12ec89bbc (diff)
downloadComputeLibrary-797b76b1aef38ea3be6f68ae2bf323048e9beff8.tar.gz
COMPMID-3221: Add EltwiseLayerDescriptor
A new descriptor struct for EltwiseLayerNode is added to have better extendability. Change-Id: I3d0a4b3cec1f2425f39157cee6b5c344336412a3 Signed-off-by: Sang-Hoon Park <sang-hoon.park@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2876 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'arm_compute/graph/LayerDescriptors.h')
-rw-r--r--arm_compute/graph/LayerDescriptors.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/arm_compute/graph/LayerDescriptors.h b/arm_compute/graph/LayerDescriptors.h
index 94074e550e..af69682fa3 100644
--- a/arm_compute/graph/LayerDescriptors.h
+++ b/arm_compute/graph/LayerDescriptors.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019 ARM Limited.
+ * Copyright (c) 2019-2020 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -21,10 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#ifndef ARM_COMPUTE_CONCAT_DESCRIPTOR_H
-#define ARM_COMPUTE_CONCAT_DESCRIPTOR_H
+#ifndef ARM_COMPUTE_LAYER_DESCRIPTORS_H
+#define ARM_COMPUTE_LAYER_DESCRIPTORS_H
#include "arm_compute/core/Types.h"
+#include "arm_compute/graph/Types.h"
namespace arm_compute
{
@@ -63,7 +64,29 @@ struct ConcatLayerDescriptor
const DataLayoutDimension axis; /**< Concatenation Axis */
const QuantizationInfo output_qinfo; /**< Output quantizazion info */
};
+
+/** Elementwise layer descriptor */
+struct EltwiseLayerDescriptor
+{
+ /** Constructor
+ *
+ * @param[in] op Element-wise operation to perform
+ * @param[in] out_quant_info (Optional) Output quantization information. Defaults to empty @ref QuantizationInfo
+ * @param[in] c_policy (Optional) Convert policy used for the operation. Defaults to @ref ConvertPolicy::SATURATE
+ * @param[in] r_policy (Optional) Rounding policy used for the operation. Defaults to @ref RoundingPolicy::TO_ZERO
+ */
+ EltwiseLayerDescriptor(EltwiseOperation op, QuantizationInfo out_quant_info = QuantizationInfo(), ConvertPolicy c_policy = ConvertPolicy::SATURATE, RoundingPolicy r_policy = RoundingPolicy::TO_ZERO)
+ : op(op), out_quant_info(out_quant_info), c_policy(c_policy), r_policy(r_policy)
+ {
+ }
+
+ EltwiseOperation op; /**< Element-wise operation to perform */
+ QuantizationInfo out_quant_info; /**< Output quantization information */
+ ConvertPolicy c_policy; /**< Convert policy */
+ RoundingPolicy r_policy; /**< Rounding policy */
+};
+
} // namespace descriptor
} // namespace graph
} // namespace arm_compute
-#endif /* ARM_COMPUTE_CONCAT_DESCRIPTOR_H */ \ No newline at end of file
+#endif /* ARM_COMPUTE_LAYER_DESCRIPTORS_H */ \ No newline at end of file