Add nntrainer option to control dependency.
This temporarily solves the cyclic dependency problem when gcov is enabled.
Signed-off-by: gichan2-jang <gichan2.jang@samsung.com>
nns_capi_pipeline_srcs = files('ml-api-inference-pipeline.c')
nns_capi_service_srcs = files('ml-api-service.c', 'ml-api-service-extension.c', 'ml-api-service-agent-client.c', 'ml-api-service-query-client.c')
if support_service_offloading
- nns_capi_service_srcs += files('ml-api-service-offloading.c', 'ml-api-service-training-offloading.c')
+ nns_capi_service_srcs += files('ml-api-service-offloading.c')
+ if support_training_offloading
+ nns_capi_service_srcs += files('ml-api-service-training-offloading.c')
+ endif
endif
if get_option('enable-tizen')
{
ml_service_s *mls = (ml_service_s *) handle;
_ml_service_offloading_s *offloading_s;
+ int ret = ML_ERROR_NONE;
if (!_ml_service_handle_is_valid (mls)) {
_ml_error_report_return (ML_ERROR_INVALID_PARAMETER,
offloading_s->path = g_strdup (value);
if (offloading_s->offloading_mode == ML_SERVICE_OFFLOADING_MODE_TRAINING) {
- ml_service_training_offloading_set_path (mls, offloading_s->path);
+ ret = ml_service_training_offloading_set_path (mls, offloading_s->path);
}
}
- return ML_ERROR_NONE;
+ return ret;
}
/**
extern "C" {
#endif /* __cplusplus */
+#if defined(ENABLE_TRAINING_OFFLOADING)
/**
* @brief Creates a training offloading handle for ml-service training offloading service.
* @param[in] mls ml-service handle created by ml_service_new().
* @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
*/
int ml_service_training_offloading_destroy (ml_service_s *mls);
-
+#else
+#define ml_service_training_offloading_create(...) ML_ERROR_NOT_SUPPORTED
+#define ml_service_training_offloading_set_path(...) ML_ERROR_NOT_SUPPORTED
+#define ml_service_training_offloading_start(...) ML_ERROR_NOT_SUPPORTED
+#define ml_service_training_offloading_stop(...) ML_ERROR_NOT_SUPPORTED
+#define ml_service_training_offloading_process_received_data(...)
+#define ml_service_training_offloading_destroy(...) ML_ERROR_NOT_SUPPORTED
+#endif /* ENABLE_TRAINING_OFFLOADING */
#ifdef __cplusplus
}
#endif /* __cplusplus */
endif
endif
+support_training_offloading = false
+if get_option('enable-nntrainer')
+ add_project_arguments('-DENABLE_TRAINING_OFFLOADING=1', language: ['c', 'cpp'])
+ support_training_offloading = true
+endif
+
# Set version info
api_version = meson.project_version()
api_version_split = api_version.split('.')
option('enable-ml-service', type: 'boolean', value: false)
option('java-home', type: 'string', value: '')
option('enable-gcov', type: 'boolean', value: false, description: 'Generate gcov package')
+option('enable-nntrainer', type: 'boolean', value: false)
%define unit_test 1
%define release_test 1
%define testcoverage 1
+%define nntrainer_support 0
%endif
# For test
%define enable_tizen_feature_check -Denable-tizen-feature-check=false
%define enable_ml_service_check -Denable-ml-service=false
%define enable_gcov -Denable-gcov=false
+%define enable_nntrainer -Denable-nntrainer=false
%if %{with tizen}
%define enable_tizen -Denable-tizen=true -Dtizen-version-major=0%{?tizen_version_major} -Dtizen-version-minor=0%{?tizen_version_minor}
%define enable_gcov -Denable-gcov=true
%endif
+%if 0%{?nntrainer_support}
+%define enable_nntrainer -Denable-nntrainer=true
+%endif
+
%prep
%setup -q
cp %{SOURCE1001} .
--bindir=%{_bindir} --includedir=%{_includedir} \
%{enable_test} %{install_test} %{enable_test_coverage} \
%{enable_tizen} %{enable_tizen_privilege_check} %{enable_tizen_feature_check} \
- %{enable_ml_service_check} %{enable_gcov} \
+ %{enable_ml_service_check} %{enable_gcov} %{enable_nntrainer} \
build
ninja -C build %{?_smp_mflags}
bash %{test_script} ./tests/capi/unittest_capi_service_agent_client
%if 0%{?nnstreamer_edge_support}
bash %{test_script} ./tests/capi/unittest_capi_service_offloading
+%if 0%{?nntrainer_support}
bash %{test_script} ./tests/capi/unittest_capi_service_training_offloading
%endif
%endif
+%endif
%if 0%{?nnfw_support}
bash %{test_script} ./tests/capi/unittest_capi_inference_nnfw_runtime
)
test('unittest_capi_service_offloading', unittest_capi_service_offloading, env: testenv, timeout: 100)
- unittest_capi_service_training_offloading = executable('unittest_capi_service_training_offloading',
- 'unittest_capi_service_training_offloading.cc',
- dependencies: service_unittest_deps,
- install: get_option('install-test'),
- install_dir: unittest_install_dir
- )
- test('unittest_capi_service_training_offloading', unittest_capi_service_training_offloading, env: testenv, timeout: 100)
+ if support_training_offloading
+ unittest_capi_service_training_offloading = executable('unittest_capi_service_training_offloading',
+ 'unittest_capi_service_training_offloading.cc',
+ dependencies: service_unittest_deps,
+ install: get_option('install-test'),
+ install_dir: unittest_install_dir
+ )
+ test('unittest_capi_service_training_offloading', unittest_capi_service_training_offloading, env: testenv, timeout: 100)
+ endif
endif
endif