From: Efimov Alexander/AI Tools Lab/./Samsung Electronics Date: Mon, 10 Dec 2018 18:37:15 +0000 (+0300) Subject: [nnc] Add arm-c++ target (#2515) X-Git-Tag: nncc_backup~1128 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0571f53e2a56704b4423d1845370b62ab9818fe0;p=platform%2Fcore%2Fml%2Fnnfw.git [nnc] Add arm-c++ target (#2515) Adds new target option to make possible split of arm and x86 artifact generation in cpu c++ backend Signed-off-by: Efimov Alexander --- diff --git a/contrib/nnc/driver/Driver.cpp b/contrib/nnc/driver/Driver.cpp index 2eab95f..f8798e1 100644 --- a/contrib/nnc/driver/Driver.cpp +++ b/contrib/nnc/driver/Driver.cpp @@ -121,7 +121,9 @@ void Driver::registerBackendPass() { std::unique_ptr pass; - if (cli::target == NNC_TARGET_X86_CPP) { + if (cli::target == NNC_TARGET_ARM_CPP) { + pass = std::move(std::unique_ptr(new CPPCodeGenerator())); + } else if (cli::target == NNC_TARGET_X86_CPP) { pass = std::move(std::unique_ptr(new CPPCodeGenerator())); } else if (cli::target == NNC_TARGET_ARM_GPU_CPP) { pass = std::move(std::unique_ptr(new AclCppCodeGenerator())); diff --git a/contrib/nnc/driver/Options.cpp b/contrib/nnc/driver/Options.cpp index 028bd67..0fc613e 100644 --- a/contrib/nnc/driver/Options.cpp +++ b/contrib/nnc/driver/Options.cpp @@ -117,10 +117,17 @@ Option tflFrontend(optname("--tflite"), ); Option target(optname("--target"), overview("select target language to emit for given architecture." - "Valid values are '" NNC_TARGET_X86_CPP "', '" NNC_TARGET_ARM_GPU_CPP "', '" NNC_TARGET_INTERPRETER "'"), + "Valid values are '" + NNC_TARGET_ARM_CPP "', '" + NNC_TARGET_X86_CPP "', '" + NNC_TARGET_ARM_GPU_CPP "', '" + NNC_TARGET_INTERPRETER "'"), std::string(), optional(false), - optvalues(NNC_TARGET_X86_CPP "," NNC_TARGET_ARM_GPU_CPP "," NNC_TARGET_INTERPRETER), + optvalues(NNC_TARGET_ARM_CPP "," + NNC_TARGET_X86_CPP "," + NNC_TARGET_ARM_GPU_CPP "," + NNC_TARGET_INTERPRETER), nullptr, separators("=")); diff --git a/contrib/nnc/include/option/Options.h b/contrib/nnc/include/option/Options.h index 0ce2c4b..670afc8 100644 --- a/contrib/nnc/include/option/Options.h +++ b/contrib/nnc/include/option/Options.h @@ -37,6 +37,7 @@ extern Option tflFrontend; // frontend for TensorFlow Lite AI framework extern Option onnxFrontend; // frontend for ONNX AI framework // valid values for target option +#define NNC_TARGET_ARM_CPP "arm-c++" #define NNC_TARGET_X86_CPP "x86-c++" #define NNC_TARGET_ARM_GPU_CPP "arm-gpu-c++" #define NNC_TARGET_INTERPRETER "interpreter"