summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTae-Young Chung <ty83.chung@samsung.com>2021-06-01 15:39:01 +0900
committerTae-Young Chung <ty83.chung@samsung.com>2021-06-01 17:06:42 +0900
commit72c9ff51fe7715313edb65ee2a62664049381111 (patch)
treeb5d361a40bd11a1184d62a76faac785c1ec31201
parent119dbfddd4bcb0acf4881aa2191d55f375668a37 (diff)
downloadinference-engine-interface-sandbox/tizen_ar.tar.gz
inference-engine-interface-sandbox/tizen_ar.tar.bz2
inference-engine-interface-sandbox/tizen_ar.zip
Disable an ini file for backend pathsandbox/tizen_ar
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>
-rw-r--r--CMakeLists.txt2
-rw-r--r--packaging/inference-engine-interface.spec30
-rw-r--r--src/inference_engine_common_impl.cpp29
-rw-r--r--src/inference_ini.cpp12
4 files changed, 53 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 30eb6ae..09040ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/packaging/inference-engine-interface.spec b/packaging/inference-engine-interface.spec
index d7bd6b0..8fd7651 100644
--- a/packaging/inference-engine-interface.spec
+++ b/packaging/inference-engine-interface.spec
@@ -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
diff --git a/src/inference_engine_common_impl.cpp b/src/inference_engine_common_impl.cpp
index 3835469..a1273df 100644
--- a/src/inference_engine_common_impl.cpp
+++ b/src/inference_engine_common_impl.cpp
@@ -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;
}
diff --git a/src/inference_ini.cpp b/src/inference_ini.cpp
index 0267a72..608c267 100644
--- a/src/inference_ini.cpp
+++ b/src/inference_ini.cpp
@@ -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;
}