From 189664eb1c549e6004cb4fc2aa68592d6ea460a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=ED=95=9C=EC=A2=85/On-Device=20Lab=28SR=29/Enginee?= =?utf8?q?r/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Fri, 20 Sep 2019 15:57:25 +0900 Subject: [PATCH] [neurun] Implement a hash functor for enum class (#7647) Implement a hash functor for enum class `NodeName` since Android NDK clang requires it. * This is a fix for Android Build Signed-off-by: Hanjoung Lee --- runtimes/neurun/core/src/exec/interp/Interpreter.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/runtimes/neurun/core/src/exec/interp/Interpreter.cc b/runtimes/neurun/core/src/exec/interp/Interpreter.cc index 81de27c..1b66a14 100644 --- a/runtimes/neurun/core/src/exec/interp/Interpreter.cc +++ b/runtimes/neurun/core/src/exec/interp/Interpreter.cc @@ -46,6 +46,15 @@ public: }; #undef OP + struct NodeNameHash + { + size_t operator()(::neurun::exec::interp::OperationExecutor::NodeName value) const noexcept + { + using type = typename std::underlying_type::type; + return std::hash()(static_cast(value)); + } + }; + public: OperationExecutor(ExecEnv *env) : _env{env} { @@ -83,7 +92,7 @@ private: private: ExecEnv *_env; - std::unordered_map _kernels; + std::unordered_map _kernels; }; void Interpreter::run() -- 2.7.4