aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/graph/nodes/FullyConnectedLayerNode.h
diff options
context:
space:
mode:
authorcfRod <crefeda.rodrigues@arm.com>2021-11-05 11:29:53 +0000
committerGian Marco Iodice <gianmarco.iodice@arm.com>2021-11-09 10:19:03 +0000
commitf2c022e54ae65467cca4bc698b5b94e5b3c62c47 (patch)
treedcf3f38e85ff9761573d2e7e37cc746291f828af /arm_compute/graph/nodes/FullyConnectedLayerNode.h
parentf349655cf75a686ed97e90d193a45602d6e82e6f (diff)
downloadComputeLibrary-f2c022e54ae65467cca4bc698b5b94e5b3c62c47.tar.gz
Enable fast_math in CpuFullyConnected
ONCPUML-529 * Add support for passing fast_math for fullyconnected layers via fc_info. * Add support for passing fast_math to run ACL benchmark graphs. * Add validation test and accuracy tests (updated fixtures). Note: abs and rel. tolerance for fast math mode are set based on experimental data. Signed-off-by: cfRod <crefeda.rodrigues@arm.com> change-Id: Ib107d6264d3ae5e36555334f39a13e678f8618df Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6521 Reviewed-by: SiCong Li <sicong.li@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/graph/nodes/FullyConnectedLayerNode.h')
-rw-r--r--arm_compute/graph/nodes/FullyConnectedLayerNode.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/arm_compute/graph/nodes/FullyConnectedLayerNode.h b/arm_compute/graph/nodes/FullyConnectedLayerNode.h
index a7712f46b9..9ade62bf4a 100644
--- a/arm_compute/graph/nodes/FullyConnectedLayerNode.h
+++ b/arm_compute/graph/nodes/FullyConnectedLayerNode.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 Arm Limited.
+ * Copyright (c) 2018-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -39,10 +39,22 @@ public:
* @param[in] num_outputs Number of neurons in the layer
* @param[in] out_quant_info (Optional) Output quantization info
* @param[in] fc_info (Optional) Additional information about the fully connected layer
+ * @param[in] fast_math_hint (Optional) Fast math hint
*/
FullyConnectedLayerNode(unsigned int num_outputs,
QuantizationInfo out_quant_info = QuantizationInfo(),
- FullyConnectedLayerInfo fc_info = FullyConnectedLayerInfo());
+ FullyConnectedLayerInfo fc_info = FullyConnectedLayerInfo(),
+ FastMathHint fast_math_hint = FastMathHint::Disabled);
+ /** Sets the fast math fast hint
+ *
+ * @param[in] hint Hint to use for fullyconnected layer
+ */
+ void set_fast_math_hint(FastMathHint hint);
+ /** Fast math hint accessor
+ *
+ * @return Fast math hint to be used by the node
+ */
+ FastMathHint fast_math_hint() const;
/** Sets fused activation
*
* @param[in] fused_activation Fused activation to set
@@ -94,6 +106,7 @@ private:
unsigned int _num_outputs;
QuantizationInfo _out_quant_info;
FullyConnectedLayerInfo _info;
+ FastMathHint _fast_math_hint;
};
} // namespace graph
} // namespace arm_compute