Disable an ini file for backend path 05/259105/2 sandbox/tizen_ar
authorTae-Young Chung <ty83.chung@samsung.com>
Tue, 1 Jun 2021 06:39:01 +0000 (15:39 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Tue, 1 Jun 2021 08:06:42 +0000 (17:06 +0900)
Temporally, disable an ini file which is for setting path backend engine.
So, an ini can be removed.

Change-Id: I6ddc00e066a16c1460d3eeed81d32f186d15d8ba
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
CMakeLists.txt
packaging/inference-engine-interface.spec
src/inference_engine_common_impl.cpp
src/inference_ini.cpp

index 30eb6aeb58aa3b1340af7bcd479f807f146b9e91..09040ca9f345f259ce2153a53fe2f58f17f076f2 100644 (file)
@@ -63,7 +63,7 @@ CONFIGURE_FILE(
 )
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name_common}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
-ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/test)
+#ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/test)
 
 IF(UNIX)
 
index d7bd6b00459d5490512f7c2e610da952f8468eec..8fd7651b7d7624c6ab1c0d924aa63543964e1349 100644 (file)
@@ -7,10 +7,10 @@ License:     Apache-2.0
 Source0:     %{name}-%{version}.tar.gz
 BuildRequires: cmake
 BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(libtzplatform-config)
+#BuildRequires: pkgconfig(libtzplatform-config)
 BuildRequires: pkgconfig(python)
 BuildRequires: pkgconfig(iniparser)
-BuildRequires: gtest-devel
+#BuildRequires: gtest-devel
 
 %description
 Interface of inference engines
@@ -49,25 +49,25 @@ export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
 %endif
 
-export CFLAGS+=" -DPATH_LIBDIR=\\\"%{_libdir}\\\" -DSYSCONFDIR=\\\"%{_sysconfdir}\\\""
-export CXXFLAGS+=" -DPATH_LIBDIR=\\\"%{_libdir}\\\" -DSYSCONFDIR=\\\"%{_sysconfdir}\\\""
+export CFLAGS+=" -DPATH_LIBDIR=\\\"%{_libdir}\\\""
+export CXXFLAGS+=" -DPATH_LIBDIR=\\\"%{_libdir}\\\""
 
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DTZ_SYS_BIN=%TZ_SYS_BIN \
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
 
 make %{?jobs:-j%jobs}
 
 %install
 rm -rf %{buildroot}
 
-mkdir -p %{buildroot}/usr/bin/
-mkdir -p %{buildroot}/opt/usr/images/
+#mkdir -p %{buildroot}/usr/bin/
+#mkdir -p %{buildroot}/opt/usr/images/
 %make_install
 
-install -m 755 test/bin/inference_engine_profiler %{buildroot}%{_bindir}
-install -m 755 test/bin/inference_engine_tc %{buildroot}%{_bindir}
-install -m 755 start_profiler.sh %{buildroot}%{_bindir}
-install -m 666 test/res/*.bin %{buildroot}/opt/usr/images
+#install -m 755 test/bin/inference_engine_profiler %{buildroot}%{_bindir}
+#install -m 755 test/bin/inference_engine_tc %{buildroot}%{_bindir}
+#install -m 755 start_profiler.sh %{buildroot}%{_bindir}
+#install -m 666 test/res/*.bin %{buildroot}/opt/usr/images
 
 %post -p /sbin/ldconfig
 %postun -p /sbin/ldconfig
@@ -81,7 +81,7 @@ install -m 666 test/res/*.bin %{buildroot}/opt/usr/images
 %{_includedir}/media/*.h
 %{_libdir}/pkgconfig/*common.pc
 %{_libdir}/lib*-common.so
-%{_bindir}/inference_engine_profiler
-%{_bindir}/inference_engine_tc
-%{_bindir}/start_profiler.sh
-/opt/usr/images/*.bin
+#%{_bindir}/inference_engine_profiler
+#%{_bindir}/inference_engine_tc
+#%{_bindir}/start_profiler.sh
+#/opt/usr/images/*.bin
index 3835469803a9b74d6b56b8a073e069758f1f63d7..a1273dfa1f67db51f4f4c639aa25586c60b25891 100644 (file)
@@ -47,8 +47,10 @@ namespace InferenceEngineInterface
 {
 namespace Common
 {
+#if 0
        const char *BACKEND_PATH_INI_FILENAME =
                                "/etc/inference/inference_engine_backend_path.ini";
+#endif
        std::map<std::string, inference_backend_type_e> sApiFw =
        {
                { "MLAPI", INFERENCE_BACKEND_MLAPI }
@@ -145,6 +147,31 @@ namespace Common
        int InferenceEngineCommon::LoadConfigFile(std::string ini_file_path)
        {
                int ret = INFERENCE_ENGINE_ERROR_NONE;
+#if 1
+               sBackendForNpu = -1;
+               if (sBackendForNpu < 0) {
+                       LOGI("No NPU backend type from ini file.");
+                       LOGI("This platform cannot use NPU acceleration for inference.");
+               }
+
+               LOGI("API FW = %s, NPU = %d", sBackendForNpu > 0 ? "MLAPI" : "Internal", sBackendForNpu);
+
+               sApiFwForTFLITE = INFERENCE_BACKEND_MLAPI;
+               if (sApiFwForTFLITE < 0) {
+                       LOGI("No API framework type from ini file.");
+                       LOGI("So in default, internal API will be used for TFLITE.");
+               }
+
+               LOGI("API FW = %s for TFLITE.", sApiFwForTFLITE > 0 ? "MLAPI" : "Internal");
+
+               sApiFwForARMNN = -1;
+               if (sApiFwForARMNN < 0) {
+                       LOGI("No API framework type from ini file.");
+                       LOGI("So in default, internal API will be used for ARMNN.");
+               }
+
+               LOGI("API FW = %s for ARMNN.", sApiFwForARMNN > 0 ? "MLAPI" : "Internal");
+#else
                std::string strNpuBackend = "", strApiFwName = "";
 
                if (ini_file_path.empty())
@@ -184,7 +211,7 @@ namespace Common
                LOGI("API FW = %s for ARMNN.", sApiFwForARMNN > 0 ? "MLAPI" : "Internal");
 
                iniparser_freedict(dict);
-
+#endif
                return ret;
        }
 
index 0267a722620243479e5eb298b3ab6a4c45d185a5..608c267fad49d49ce4879064154071fa02617c63 100644 (file)
@@ -35,15 +35,18 @@ namespace InferenceEngineInterface
 {
 namespace Common
 {
+#if 0
        const std::string INFERENCE_INI_FILENAME =
                        "/inference/inference_engine.ini";
-
+#endif
        InferenceEngineInI::InferenceEngineInI()
-                       : mIniDefaultPath(SYSCONFDIR)
+                       : mIniDefaultPath()
                        , mSelectedBackendEngine(INFERENCE_BACKEND_NONE)
        {
                LOGE("ENTER");
+#if 0          
                mIniDefaultPath += INFERENCE_INI_FILENAME;
+#endif         
                LOGE("LEAVE");
        }
 
@@ -55,6 +58,9 @@ namespace Common
        int InferenceEngineInI::LoadInI()
        {
                LOGE("ENTER");
+#if 1          
+               mSelectedBackendEngine = INFERENCE_BACKEND_NONE;
+#else
                dictionary *dict = iniparser_load(mIniDefaultPath.c_str());
                if (dict == NULL) {
                        LOGE("Fail to load ini");
@@ -69,7 +75,7 @@ namespace Common
                        iniparser_freedict(dict);
                        dict = NULL;
                }
-
+#endif
                LOGE("LEAVE");
                return 0;
        }