From 81fd60caa79fbbdefd0882b28481abfdf491dff4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9E=A5=EC=A7=80=EC=84=AD/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84?= =?utf8?q?=EC=9E=90?= Date: Mon, 26 Nov 2018 19:55:40 +0900 Subject: [PATCH] Apply CL Kernel of HashtableLookup for PACL (#3701) This commit applies CL Kernel of HashtableLookup for PACL. Signed-off-by: jiseob.jang --- runtimes/pure_arm_compute/src/compilation.cc | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/runtimes/pure_arm_compute/src/compilation.cc b/runtimes/pure_arm_compute/src/compilation.cc index 8f9cf58..3b5a110 100644 --- a/runtimes/pure_arm_compute/src/compilation.cc +++ b/runtimes/pure_arm_compute/src/compilation.cc @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -4737,11 +4738,28 @@ void Planner::visit(const ::internal::tflite::op::HashtableLookup::Node &node) auto values_alloc = ctx.at(::internal::tflite::operand::Index{param.values_index}); auto keys_alloc = ctx.at(::internal::tflite::operand::Index{param.keys_index}); - auto fn = nnfw::make_unique(); + if (from_env(std::getenv("USE_SIMPLE_HASHTABLELOOKUP"))) + { + auto fn = nnfw::make_unique(); + + fn->configure(lookups_alloc, keys_alloc, values_alloc, output_alloc, hits_alloc); + + builder.append("HashtableLookup", std::move(fn)); + } + else if (::internal::arm_compute::isGpuMode()) // GPU + { + auto fn = nnfw::make_unique<::arm_compute::CLHashtableLookup>(); - fn->configure(lookups_alloc, keys_alloc, values_alloc, output_alloc, hits_alloc); + fn->configure(CAST_CL(lookups_alloc), CAST_CL(keys_alloc), CAST_CL(values_alloc), + CAST_CL(output_alloc), CAST_CL(hits_alloc)); - builder.append("HashtableLookup", std::move(fn)); + builder.append("HashtableLookup", std::move(fn)); + } + else // NEON + { + // TODO Enable NEON Support + throw std::runtime_error("Not supported, yet"); + } }; _builder.addStage(stage); -- 2.7.4