From 93581a524a8e66ed29ace892bc5cb297287802af Mon Sep 17 00:00:00 2001 From: Pablo Marquez Tello Date: Thu, 21 Jul 2022 13:55:27 +0100 Subject: [ONCPUML-970] Fast math mode for fixed format kernels Minor tweaks and test for running fixed format kernels with BF16 operations when specified by the user. Change-Id: Ic8167f67b86b1298da65e46cfebed9f3b86940e4 Signed-off-by: Milos Puzovic Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8000 Tested-by: Arm Jenkins Reviewed-by: Gunes Bayir Comments-Addressed: Arm Jenkins Benchmark: Arm Jenkins --- arm_compute/core/Types.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'arm_compute/core/Types.h') diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index 66e1c8ab1f..952c174194 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -1987,16 +1987,20 @@ enum class WeightFormat // OHWIoi inline int interleave_by(const WeightFormat wf) { - return ((int)wf >> 8) & 0xFFF; + return (static_cast(wf) >> 8) & 0xFFF; } inline int block_by(const WeightFormat wf) { - return ((int)wf >> 20) & 0xF; + return (static_cast(wf) >> 20) & 0xF; } -inline bool is_fixed_format(const WeightFormat wf) +inline bool is_fixed_format(const WeightFormat &wf) { return wf != WeightFormat::UNSPECIFIED && wf != WeightFormat::ANY; } +inline bool is_fixed_format_fast_math(const WeightFormat &wf) +{ + return (static_cast(wf) >> 4) & 0x1; +} /** Convolution Layer Weights Information class. This class stores the necessary information to compute convolution layer when the weights are already reshaped */ class WeightsInfo -- cgit v1.2.1