Only enable mixed precision FP16 pooling for Android Q
authorDerek Lamberti <derek.lamberti@arm.com>
Wed, 13 Nov 2019 09:29:38 +0000 (09:29 +0000)
committerMatteo Martincigh <matteo.martincigh@arm.com>
Fri, 15 Nov 2019 11:01:14 +0000 (11:01 +0000)
Change-Id: Ic2c0ce7a7a99bbc430b7d6da272825540772e01d
Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Android.mk
src/backends/cl/workloads/ClPooling2dWorkload.cpp

index 749c411..6daefef 100644 (file)
@@ -307,6 +307,14 @@ LOCAL_CFLAGS += \
         -DARMNNREF_ENABLED
 endif # ARMNN_REF_ENABLED == 1
 
+# Only enable on Android P
+ifeq (($(P_OR_LATER),1))
+  ifeq (($(Q_OR_LATER),0))
+LOCAL_CFLAGS += \
+        -DARMNN_MIXED_PRECISION_FP16_POOLING
+  endif # Q_OR_LATER=0
+endif # P_OR_LATER=1
+
 ifeq ($(Q_OR_LATER),1)
 LOCAL_CFLAGS += \
         -DBOOST_NO_AUTO_PTR
index bf89997..8400977 100644 (file)
@@ -44,14 +44,13 @@ ClPooling2dWorkload::ClPooling2dWorkload(
     // enable fp_mixed_precision for the the FP16 cases that
     // accumulation reaches a limit beyond which there is no more increment of the value
     bool fpMixedPrecision = false;
+#ifdef ARMNN_MIXED_PRECISION_FP16_POOLING
     if (input.info()->data_type() == arm_compute::DataType::F16
-        && m_Data.m_Parameters.m_PoolType == PoolingAlgorithm::Average
-        && m_Data.m_Parameters.m_PoolWidth >= 100
-        && input.info()->dimension(3) >= 5
-        && input.info()->dimension(2) * input.info()->dimension(1) >= 3000)
+        && m_Data.m_Parameters.m_PoolType == PoolingAlgorithm::Average)
     {
         fpMixedPrecision = true;
     }
+#endif
 
     arm_compute::PoolingLayerInfo layerInfo = BuildArmComputePoolingLayerInfo(m_Data.m_Parameters, fpMixedPrecision);