aboutsummaryrefslogtreecommitdiff
path: root/1.3/HalPolicy.cpp
diff options
context:
space:
mode:
authorSadik Armagan <sadik.armagan@arm.com>2020-03-31 15:36:25 +0100
committerSadik Armagan <sadik.armagan@arm.com>2020-03-31 15:36:25 +0100
commit51ba2c6e0f83d2891a92c63fc30001de761e0789 (patch)
treedb11303d0f2cda397ee9eda1361b0c1622d216a4 /1.3/HalPolicy.cpp
parenta984702d6e44708eb7b2dbc678d47faf04769c67 (diff)
downloadandroid-nn-driver-51ba2c6e0f83d2891a92c63fc30001de761e0789.tar.gz
IVGCVSW-4407 HAL 1.3 Operators Support
* IVGCVSW-4441 Add Support for ANEURALNETWORKS_ELU * IVGCVSW-4443 Add Support for ANEURALNETWORKS_HARD_SWISH * IVGCVSW-4448 Add TENSOR_QUANT8_ASYMM_SIGNED data type support Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: Idb9bb3f463b956221711423c15b6557eeb1af7db
Diffstat (limited to '1.3/HalPolicy.cpp')
-rw-r--r--1.3/HalPolicy.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/1.3/HalPolicy.cpp b/1.3/HalPolicy.cpp
index 0de7573..28d7319 100644
--- a/1.3/HalPolicy.cpp
+++ b/1.3/HalPolicy.cpp
@@ -45,6 +45,8 @@ bool HalPolicy::ConvertOperation(const Operation& operation, const Model& model,
return ConvertDequantize(operation, model, data);
case V1_3::OperationType::DIV:
return ConvertDiv(operation, model, data);
+ case V1_3::OperationType::ELU:
+ return ConvertElu(operation, model, data);
case V1_3::OperationType::EQUAL:
return ConvertComparison(operation, model, data, ComparisonOperation::Equal);
case V1_3::OperationType::EXPAND_DIMS:
@@ -59,6 +61,8 @@ bool HalPolicy::ConvertOperation(const Operation& operation, const Model& model,
return ConvertComparison(operation, model, data, ComparisonOperation::GreaterOrEqual);
case V1_3::OperationType::GROUPED_CONV_2D:
return ConvertGroupedConv2d(operation, model, data);
+ case V1_3::OperationType::HARD_SWISH:
+ return ConvertHardSwish(operation, model, data);
case V1_3::OperationType::INSTANCE_NORMALIZATION:
return ConvertInstanceNormalization(operation, model, data);
case V1_3::OperationType::L2_NORMALIZATION:
@@ -223,6 +227,15 @@ bool HalPolicy::ConvertElementwiseUnary(const Operation& operation,
return ::ConvertElementwiseUnary<hal_1_3::HalPolicy>(operation, model, data, unaryOperation);
}
+bool HalPolicy::ConvertElu(const Operation& operation, const Model& model, ConversionData& data)
+{
+ ALOGV("hal_1_3::HalPolicy::ConvertElu()");
+ ActivationDescriptor desc;
+ desc.m_Function = ActivationFunction::Elu;
+
+ return ::ConvertToActivation<hal_1_3::HalPolicy>(operation, __func__, desc, model, data);
+}
+
bool HalPolicy::ConvertExpandDims(const Operation& operation, const Model& model, ConversionData& data)
{
ALOGV("hal_1_3::HalPolicy::ConvertExpandDims()");
@@ -247,6 +260,15 @@ bool HalPolicy::ConvertGroupedConv2d(const Operation& operation, const Model& mo
return ::ConvertGroupedConv2d<hal_1_3::HalPolicy>(operation, model, data);
}
+bool HalPolicy::ConvertHardSwish(const Operation& operation, const Model& model, ConversionData& data)
+{
+ ALOGV("hal_1_3::HalPolicy::ConvertHardSwish()");
+ ActivationDescriptor desc;
+ desc.m_Function = ActivationFunction::HardSwish;
+
+ return ::ConvertToActivation<hal_1_3::HalPolicy>(operation, __func__, desc, model, data);
+}
+
bool HalPolicy::ConvertInstanceNormalization(const Operation& operation, const Model& model, ConversionData& data)
{
ALOGV("hal_1_3::HalPolicy::ConvertInstanceNormalization()");