summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author장지섭/On-Device Lab(SR)/Engineer/삼성전자 <jiseob.jang@samsung.com>2019-09-17 11:48:29 (GMT)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>2019-09-17 11:48:29 (GMT)
commit0d47a522ac5014465cb42715ef65e8ed9ff7fe03 (patch)
tree452bcceb5ae47adb6f3416fdad096f78e649eba9
parent28b2016e8983a8fc03b4db4c631c15c3a7ac819e (diff)
downloadnnfw-0d47a522ac5014465cb42715ef65e8ed9ff7fe03.zip
nnfw-0d47a522ac5014465cb42715ef65e8ed9ff7fe03.tar.gz
nnfw-0d47a522ac5014465cb42715ef65e8ed9ff7fe03.tar.bz2
Make to support Dequantize op for acl neon (#7522)
This commit makes to support Dequantize op for acl neon. Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
-rw-r--r--runtimes/neurun/backend/acl_neon/KernelGenerator.cc17
-rw-r--r--runtimes/neurun/backend/acl_neon/KernelGenerator.h1
-rw-r--r--runtimes/neurun/backend/acl_neon/ShapeFixer.cc2
-rw-r--r--runtimes/neurun/backend/acl_neon/ShapeFixer.h1
4 files changed, 21 insertions, 0 deletions
diff --git a/runtimes/neurun/backend/acl_neon/KernelGenerator.cc b/runtimes/neurun/backend/acl_neon/KernelGenerator.cc
index a05fa8b..169b884 100644
--- a/runtimes/neurun/backend/acl_neon/KernelGenerator.cc
+++ b/runtimes/neurun/backend/acl_neon/KernelGenerator.cc
@@ -314,6 +314,23 @@ void KernelGenerator::visit(const model::operation::DepthwiseConv2DNode &node)
}
}
+void KernelGenerator::visit(const model::operation::DequantizeNode &node)
+{
+ const auto output_index{node.getOutputs().at(0)};
+ const auto input_index{node.getInputs().at(model::operation::DequantizeNode::Input::INPUT)};
+
+ auto output_alloc = _tensor_builder->at(output_index).get();
+ auto input_alloc = _tensor_builder->at(input_index).get();
+
+ auto fn = nnfw::cpp14::make_unique<::arm_compute::NEDequantizationLayer>();
+
+ fn->configure(input_alloc->handle(), output_alloc->handle());
+
+ auto acl_fn = asAclFunction(std::move(fn));
+
+ _execution_builder->append(std::move(acl_fn));
+}
+
void KernelGenerator::visit(const model::operation::MaxPool2DNode &node)
{
const auto ofm_index{node.getOutputs().at(0)};
diff --git a/runtimes/neurun/backend/acl_neon/KernelGenerator.h b/runtimes/neurun/backend/acl_neon/KernelGenerator.h
index 64e8a6d..ee28061 100644
--- a/runtimes/neurun/backend/acl_neon/KernelGenerator.h
+++ b/runtimes/neurun/backend/acl_neon/KernelGenerator.h
@@ -40,6 +40,7 @@ public:
void visit(const model::operation::ArgMaxNode &) override;
void visit(const model::operation::Conv2DNode &) override;
void visit(const model::operation::DepthwiseConv2DNode &) override;
+ void visit(const model::operation::DequantizeNode &) override;
void visit(const model::operation::MaxPool2DNode &) override;
void visit(const model::operation::MeanNode &) override;
void visit(const model::operation::AvgPool2DNode &) override;
diff --git a/runtimes/neurun/backend/acl_neon/ShapeFixer.cc b/runtimes/neurun/backend/acl_neon/ShapeFixer.cc
index da52876..1ce27ef 100644
--- a/runtimes/neurun/backend/acl_neon/ShapeFixer.cc
+++ b/runtimes/neurun/backend/acl_neon/ShapeFixer.cc
@@ -67,6 +67,8 @@ void ShapeFixer::visit(const model::operation::Conv2DNode &) { /* DO NOTHING */}
void ShapeFixer::visit(const model::operation::DepthwiseConv2DNode &) { /* DO NOTHING */}
+void ShapeFixer::visit(const model::operation::DequantizeNode &) { /* DO NOTHING */}
+
void ShapeFixer::visit(const model::operation::MaxPool2DNode &) { /* DO NOTHING */}
void ShapeFixer::visit(const model::operation::MeanNode &) { /* DO NOTHING */}
diff --git a/runtimes/neurun/backend/acl_neon/ShapeFixer.h b/runtimes/neurun/backend/acl_neon/ShapeFixer.h
index 1d34663..f50efdc 100644
--- a/runtimes/neurun/backend/acl_neon/ShapeFixer.h
+++ b/runtimes/neurun/backend/acl_neon/ShapeFixer.h
@@ -41,6 +41,7 @@ public:
void visit(const model::operation::ArgMaxNode &) override;
void visit(const model::operation::Conv2DNode &) override;
void visit(const model::operation::DepthwiseConv2DNode &) override;
+ void visit(const model::operation::DequantizeNode &) override;
void visit(const model::operation::MaxPool2DNode &) override;
void visit(const model::operation::MeanNode &) override;
void visit(const model::operation::AvgPool2DNode &) override;