From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Mon, 4 Jun 2018 01:51:01 +0000 (+0900) Subject: [Pure CL] Add setPreference and free (#1524) X-Git-Tag: 0.2~715 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d29afb94883ee5d70ac63128b26d1680a91f1f8e;p=platform%2Fcore%2Fml%2Fnnfw.git [Pure CL] Add setPreference and free (#1524) * [Pure CL] Add setPreference and free This commit implements ANeuralNetworksCompilation_setPreference and ANeuralNetworksCompilation_free in pure CL runtime. Signed-off-by: Jonghyun Park * Fix format errors --- diff --git a/runtimes/pure_arm_compute/src/compilation.cc b/runtimes/pure_arm_compute/src/compilation.cc index 26e31a2..3ea2e22 100644 --- a/runtimes/pure_arm_compute/src/compilation.cc +++ b/runtimes/pure_arm_compute/src/compilation.cc @@ -1402,6 +1402,14 @@ int ANeuralNetworksCompilation_create(ANeuralNetworksModel *model, return ANEURALNETWORKS_NO_ERROR; } +int ANeuralNetworksCompilation_setPreference(ANeuralNetworksCompilation *compilation, + int32_t preference) +{ + // NOTE Pure CL runimte currently ignores this API call + // TODO Use preference + return ANEURALNETWORKS_NO_ERROR; +} + int ANeuralNetworksCompilation_finish(ANeuralNetworksCompilation *compilation) { arm_compute::CLScheduler::get().default_init(); @@ -1420,3 +1428,8 @@ int ANeuralNetworksCompilation_finish(ANeuralNetworksCompilation *compilation) return ANEURALNETWORKS_NO_ERROR; } + +void ANeuralNetworksCompilation_free(ANeuralNetworksCompilation *compilation) +{ + delete compilation; +} diff --git a/runtimes/pure_arm_compute/symbolcheck.cpp b/runtimes/pure_arm_compute/symbolcheck.cpp index bc937d7..59aa08c 100644 --- a/runtimes/pure_arm_compute/symbolcheck.cpp +++ b/runtimes/pure_arm_compute/symbolcheck.cpp @@ -23,6 +23,11 @@ int main(int argc, char **argv) SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_create); SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_finish); + // ANeuralNetworksCompilation_setPreference and ANeuralNetworksCompilation_free + // are introduced to reuse NNAPI tests under runtimes/tests. Note that these APIs + // are not necessary for supporting Tensorflow Lite interperter + SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_setPreference); + SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_free); SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_create); SHOW_FUNC_ENTRY(ANeuralNetworksExecution_create); @@ -36,8 +41,6 @@ int main(int argc, char **argv) // NOTE Pure CL runtime does not implement following NN API(s) as // Tensorflow Lite does not use these API(s) - // SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_free); - // SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_setPreference); // SHOW_FUNC_ENTRY(ANeuralNetworksExecution_setInputFromMemory); // SHOW_FUNC_ENTRY(ANeuralNetworksExecution_setOutputFromMemory);