* @brief Set the feature status of machine_learning.inference.
*/
int
-ml_tizen_set_feature_state (int state)
+_ml_tizen_set_feature_state (int state)
{
ml_tizen_initialize_feature_state ();
g_mutex_lock (&feature_info->mutex);
* @brief Checks whether machine_learning.inference feature is enabled or not.
*/
int
-ml_tizen_get_feature_enabled (void)
+_ml_tizen_get_feature_enabled (void)
{
int ret;
int feature_enabled;
if (0 == ret) {
if (false == ml_inf_supported) {
_ml_loge ("machine_learning.inference NOT supported");
- ml_tizen_set_feature_state (NOT_SUPPORTED);
+ _ml_tizen_set_feature_state (NOT_SUPPORTED);
return ML_ERROR_NOT_SUPPORTED;
}
- ml_tizen_set_feature_state (SUPPORTED);
+ _ml_tizen_set_feature_state (SUPPORTED);
} else {
switch (ret) {
case SYSTEM_INFO_ERROR_INVALID_PARAMETER:
g_mutex_init (&tensors_info->lock);
/* init tensors info struct */
- return ml_tensors_info_initialize (tensors_info);
+ return _ml_tensors_info_initialize (tensors_info);
}
/**
G_LOCK_UNLESS_NOLOCK (*tensors_info);
- ml_tensors_info_free (tensors_info);
+ _ml_tensors_info_free (tensors_info);
G_UNLOCK_UNLESS_NOLOCK (*tensors_info);
g_mutex_clear (&tensors_info->lock);
g_free (tensors_info);
* @brief Initializes the tensors information with default value.
*/
int
-ml_tensors_info_initialize (ml_tensors_info_s * info)
+_ml_tensors_info_initialize (ml_tensors_info_s * info)
{
guint i, j;
* @brief Compares the given tensors information.
*/
int
-ml_tensors_info_compare (const ml_tensors_info_h info1,
+_ml_tensors_info_compare (const ml_tensors_info_h info1,
const ml_tensors_info_h info2, bool *equal)
{
ml_tensors_info_s *i1, *i2;
* @brief Gets the byte size of the given tensor info.
*/
size_t
-ml_tensor_info_get_size (const ml_tensor_info_s * info)
+_ml_tensor_info_get_size (const ml_tensor_info_s * info)
{
size_t tensor_size;
gint i;
/* get total byte size */
for (i = 0; i < tensors_info->num_tensors; i++) {
- *data_size += ml_tensor_info_get_size (&tensors_info->info[i]);
+ *data_size += _ml_tensor_info_get_size (&tensors_info->info[i]);
}
} else {
if (tensors_info->num_tensors <= index) {
return ML_ERROR_INVALID_PARAMETER;
}
- *data_size = ml_tensor_info_get_size (&tensors_info->info[index]);
+ *data_size = _ml_tensor_info_get_size (&tensors_info->info[index]);
}
G_UNLOCK_UNLESS_NOLOCK (*tensors_info);
* @note This does not touch the lock
*/
void
-ml_tensors_info_free (ml_tensors_info_s * info)
+_ml_tensors_info_free (ml_tensors_info_s * info)
{
gint i;
}
}
- ml_tensors_info_initialize (info);
+ _ml_tensors_info_initialize (info);
}
/**
* @return @c 0 on success. Otherwise a negative error value.
*/
int
-ml_tensors_data_destroy_internal (ml_tensors_data_h data, gboolean free_data)
+_ml_tensors_data_destroy_internal (ml_tensors_data_h data, gboolean free_data)
{
int status = ML_ERROR_NONE;
ml_tensors_data_s *_data;
ml_tensors_data_destroy (ml_tensors_data_h data)
{
check_feature_state ();
- return ml_tensors_data_destroy_internal (data, TRUE);
+ return _ml_tensors_data_destroy_internal (data, TRUE);
}
/**
* @note Memory for data buffer is not allocated.
*/
int
-ml_tensors_data_create_no_alloc (const ml_tensors_info_h info,
+_ml_tensors_data_create_no_alloc (const ml_tensors_info_h info,
ml_tensors_data_h * data)
{
ml_tensors_data_s *_data;
G_LOCK_UNLESS_NOLOCK (*_info);
_data->num_tensors = _info->num_tensors;
for (i = 0; i < _data->num_tensors; i++) {
- _data->tensors[i].size = ml_tensor_info_get_size (&_info->info[i]);
+ _data->tensors[i].size = _ml_tensor_info_get_size (&_info->info[i]);
_data->tensors[i].tensor = NULL;
}
G_UNLOCK_UNLESS_NOLOCK (*_info);
* @note Memory ptr for data buffer is copied. No new memory for data buffer is allocated.
*/
int
-ml_tensors_data_clone_no_alloc (const ml_tensors_data_s * data_src,
+_ml_tensors_data_clone_no_alloc (const ml_tensors_data_s * data_src,
ml_tensors_data_h * data)
{
int status;
if (data == NULL || data_src == NULL)
return ML_ERROR_INVALID_PARAMETER;
- status = ml_tensors_data_create_no_alloc (data_src->info,
+ status = _ml_tensors_data_create_no_alloc (data_src->info,
(ml_tensors_data_h *) & _data);
if (status != ML_ERROR_NONE)
return status;
}
status =
- ml_tensors_data_create_no_alloc (info, (ml_tensors_data_h *) & _data);
+ _ml_tensors_data_create_no_alloc (info, (ml_tensors_data_h *) & _data);
if (status != ML_ERROR_NONE) {
return status;
if (status != ML_ERROR_NONE || !valid)
goto done;
- ml_tensors_info_initialize (dest_info);
+ _ml_tensors_info_initialize (dest_info);
dest_info->num_tensors = src_info->num_tensors;
* @return Newly allocated string. The returned string should be freed with g_free().
*/
gchar *
-ml_replace_string (gchar * source, const gchar * what, const gchar * to,
+_ml_replace_string (gchar * source, const gchar * what, const gchar * to,
const gchar * delimiters, guint * count)
{
GString *builder;
* @brief Internal function to get the sub-plugin name.
*/
const char *
-ml_get_nnfw_subplugin_name (ml_nnfw_type_e nnfw)
+_ml_get_nnfw_subplugin_name (ml_nnfw_type_e nnfw)
{
/* check sub-plugin for android */
if (nnfw == ML_NNFW_TYPE_SNAP)
* @brief Allocates a tensors information handle from gst info.
*/
int
-ml_tensors_info_create_from_gst (ml_tensors_info_h * ml_info,
+_ml_tensors_info_create_from_gst (ml_tensors_info_h * ml_info,
GstTensorsInfo * gst_info)
{
int status;
if (status != ML_ERROR_NONE)
return status;
- ml_tensors_info_copy_from_gst (*ml_info, gst_info);
+ _ml_tensors_info_copy_from_gst (*ml_info, gst_info);
return ML_ERROR_NONE;
}
* @bug Thread safety required. Check its internal users first!
*/
void
-ml_tensors_info_copy_from_gst (ml_tensors_info_s * ml_info,
+_ml_tensors_info_copy_from_gst (ml_tensors_info_s * ml_info,
const GstTensorsInfo * gst_info)
{
guint i, j;
if (!ml_info || !gst_info)
return;
- ml_tensors_info_initialize (ml_info);
+ _ml_tensors_info_initialize (ml_info);
max_dim = MIN (ML_TENSOR_RANK_LIMIT, NNS_TENSOR_RANK_LIMIT);
ml_info->num_tensors = gst_info->num_tensors;
* @bug Thread safety required. Check its internal users first!
*/
void
-ml_tensors_info_copy_from_ml (GstTensorsInfo * gst_info,
+_ml_tensors_info_copy_from_ml (GstTensorsInfo * gst_info,
const ml_tensors_info_s * ml_info)
{
guint i, j;
* @brief Initializes the GStreamer library. This is internal function.
*/
int
-ml_initialize_gstreamer (void)
+_ml_initialize_gstreamer (void)
{
GError *err = NULL;
* @brief Internal helper function to validate model files.
*/
static int
-_ml_validate_model_file (const char *const *model,
+__ml_validate_model_file (const char *const *model,
const unsigned int num_models, gboolean * is_dir)
{
guint i;
* @brief Internal function to get the nnfw type.
*/
ml_nnfw_type_e
-ml_get_nnfw_type_by_subplugin_name (const char *name)
+_ml_get_nnfw_type_by_subplugin_name (const char *name)
{
ml_nnfw_type_e nnfw_type = ML_NNFW_TYPE_ANY;
int idx = -1;
* @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
*/
int
-ml_validate_model_file (const char *const *model,
+_ml_validate_model_file (const char *const *model,
const unsigned int num_models, ml_nnfw_type_e * nnfw)
{
int status = ML_ERROR_NONE;
if (!nnfw)
return ML_ERROR_INVALID_PARAMETER;
- status = _ml_validate_model_file (model, num_models, &is_dir);
+ status = __ml_validate_model_file (model, num_models, &is_dir);
if (status != ML_ERROR_NONE)
return status;
* If any condition for auto detection is added later, below code also should be updated.
*/
fw_name = gst_tensor_filter_detect_framework (model, num_models, TRUE);
- detected = ml_get_nnfw_type_by_subplugin_name (fw_name);
+ detected = _ml_get_nnfw_type_by_subplugin_name (fw_name);
g_free (fw_name);
if (*nnfw == ML_NNFW_TYPE_ANY) {
status = ML_ERROR_INVALID_PARAMETER;
} else {
_ml_logi ("The given model is supposed a %s model.",
- ml_get_nnfw_subplugin_name (detected));
+ _ml_get_nnfw_subplugin_name (detected));
*nnfw = detected;
}
done:
if (status == ML_ERROR_NONE) {
- if (!ml_nnfw_is_available (*nnfw, ML_NNFW_HW_ANY)) {
- _ml_loge ("%s is not available.", ml_get_nnfw_subplugin_name (*nnfw));
+ if (!_ml_nnfw_is_available (*nnfw, ML_NNFW_HW_ANY)) {
+ _ml_loge ("%s is not available.", _ml_get_nnfw_subplugin_name (*nnfw));
status = ML_ERROR_NOT_SUPPORTED;
}
} else {
* @brief Convert c-api based hw to internal representation
*/
accl_hw
-ml_nnfw_to_accl_hw (const ml_nnfw_hw_e hw)
+_ml_nnfw_to_accl_hw (const ml_nnfw_hw_e hw)
{
switch (hw) {
case ML_NNFW_HW_ANY:
* @note More details on format can be found in gst_tensor_filter_install_properties() in tensor_filter_common.c.
*/
char *
-ml_nnfw_to_str_prop (const ml_nnfw_hw_e hw)
+_ml_nnfw_to_str_prop (const ml_nnfw_hw_e hw)
{
const gchar *hw_name;
const gchar *use_accl = "true:";
gchar *str_prop = NULL;
- hw_name = get_accl_hw_str (ml_nnfw_to_accl_hw (hw));
+ hw_name = get_accl_hw_str (_ml_nnfw_to_accl_hw (hw));
str_prop = g_strdup_printf ("%s%s", use_accl, hw_name);
return str_prop;
if (!element_name || !available)
return ML_ERROR_INVALID_PARAMETER;
- status = ml_initialize_gstreamer ();
+ status = _ml_initialize_gstreamer ();
if (status != ML_ERROR_NONE)
return status;
const gchar *plugin_name = gst_plugin_feature_get_plugin_name (feature);
/* check restricted element */
- status = ml_check_plugin_availability (plugin_name, element_name);
+ status = _ml_check_plugin_availability (plugin_name, element_name);
if (status == ML_ERROR_NONE)
*available = true;
* @brief Checks the availability of the plugin.
*/
int
-ml_check_plugin_availability (const char *plugin_name, const char *element_name)
+_ml_check_plugin_availability (const char *plugin_name,
+ const char *element_name)
{
static gboolean list_loaded = FALSE;
static gchar **restricted_elements = NULL;
#if defined (__TIZEN__)
#if defined (__PRIVILEGE_CHECK_SUPPORT__)
-#define convert_tizen_element(...) ml_tizen_convert_element(__VA_ARGS__)
+#define convert_tizen_element(...) _ml_tizen_convert_element(__VA_ARGS__)
#if (TIZENVERSION >= 5) && (TIZENVERSION < 9999)
-#define get_tizen_resource(...) ml_tizen_get_resource(__VA_ARGS__)
-#define release_tizen_resource(...) ml_tizen_release_resource(__VA_ARGS__)
+#define get_tizen_resource(...) _ml_tizen_get_resource(__VA_ARGS__)
+#define release_tizen_resource(...) _ml_tizen_release_resource(__VA_ARGS__)
#elif (TIZENVERSION < 5)
#define get_tizen_resource(...) (0)
/**
* @brief Macro to check the availability of given NNFW.
*/
-#define ml_nnfw_is_available(f,h) ({bool a; (ml_check_nnfw_availability ((f), (h), &a) == ML_ERROR_NONE && a);})
+#define _ml_nnfw_is_available(f,h) ({bool a; (ml_check_nnfw_availability ((f), (h), &a) == ML_ERROR_NONE && a);})
/**
* @brief Macro to check the availability of given element.
*/
-#define ml_element_is_available(e) ({bool a; (ml_check_element_availability ((e), &a) == ML_ERROR_NONE && a);})
+#define _ml_element_is_available(e) ({bool a; (ml_check_element_availability ((e), &a) == ML_ERROR_NONE && a);})
/**
* @brief Allocates a tensors information handle from gst info.
*/
-int ml_tensors_info_create_from_gst (ml_tensors_info_h *ml_info, GstTensorsInfo *gst_info);
+int _ml_tensors_info_create_from_gst (ml_tensors_info_h *ml_info, GstTensorsInfo *gst_info);
/**
* @brief Copies tensor metadata from gst tensors info.
*/
-void ml_tensors_info_copy_from_gst (ml_tensors_info_s *ml_info, const GstTensorsInfo *gst_info);
+void _ml_tensors_info_copy_from_gst (ml_tensors_info_s *ml_info, const GstTensorsInfo *gst_info);
/**
* @brief Copies tensor metadata from ml tensors info.
*/
-void ml_tensors_info_copy_from_ml (GstTensorsInfo *gst_info, const ml_tensors_info_s *ml_info);
+void _ml_tensors_info_copy_from_ml (GstTensorsInfo *gst_info, const ml_tensors_info_s *ml_info);
/**
* @brief Internal function to get the sub-plugin name.
*/
-const char * ml_get_nnfw_subplugin_name (ml_nnfw_type_e nnfw);
+const char * _ml_get_nnfw_subplugin_name (ml_nnfw_type_e nnfw);
/**
* @brief Convert c-api based hw to internal representation
*/
-accl_hw ml_nnfw_to_accl_hw (const ml_nnfw_hw_e hw);
+accl_hw _ml_nnfw_to_accl_hw (const ml_nnfw_hw_e hw);
/**
* @brief Internal function to get the nnfw type.
*/
-ml_nnfw_type_e ml_get_nnfw_type_by_subplugin_name (const char *name);
+ml_nnfw_type_e _ml_get_nnfw_type_by_subplugin_name (const char *name);
/**
* @brief Initializes the GStreamer library. This is internal function.
*/
-int ml_initialize_gstreamer (void);
+int _ml_initialize_gstreamer (void);
/**
* @brief Validates the nnfw model file. (Internal only)
* @retval #ML_ERROR_NOT_SUPPORTED Not supported.
* @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
*/
-int ml_validate_model_file (const char * const *model, const unsigned int num_models, ml_nnfw_type_e * nnfw);
+int _ml_validate_model_file (const char * const *model, const unsigned int num_models, ml_nnfw_type_e * nnfw);
/**
* @brief Checks the availability of the plugin.
*/
-int ml_check_plugin_availability (const char *plugin_name, const char *element_name);
+int _ml_check_plugin_availability (const char *plugin_name, const char *element_name);
/**
* @brief Internal function to convert accelerator as tensor_filter property format.
* @note returned value must be freed by the caller
*/
-char* ml_nnfw_to_str_prop (ml_nnfw_hw_e hw);
+char* _ml_nnfw_to_str_prop (ml_nnfw_hw_e hw);
/**
* @brief Gets the element of pipeline itself (GstElement).
* Note that caller should release the returned reference using gst_object_unref().
* @return The reference of pipeline itself. Null if the pipeline is not constructed or closed.
*/
-GstElement* ml_pipeline_get_gst_element (ml_pipeline_h pipe);
+GstElement* _ml_pipeline_get_gst_element (ml_pipeline_h pipe);
#if defined (__TIZEN__)
/****** TIZEN PRIVILEGE CHECK BEGINS ******/
/**
* @brief Releases the resource handle of Tizen.
*/
-void ml_tizen_release_resource (gpointer handle, const gchar * res_type);
+void _ml_tizen_release_resource (gpointer handle, const gchar * res_type);
/**
* @brief Gets the resource handle of Tizen.
*/
-int ml_tizen_get_resource (ml_pipeline_h pipe, const gchar * res_type);
+int _ml_tizen_get_resource (ml_pipeline_h pipe, const gchar * res_type);
/**
* @brief Converts predefined element for Tizen.
*/
-int ml_tizen_convert_element (ml_pipeline_h pipe, gchar ** result, gboolean is_internal);
+int _ml_tizen_convert_element (ml_pipeline_h pipe, gchar ** result, gboolean is_internal);
/****** TIZEN PRIVILEGE CHECK ENDS ******/
#endif /* __TIZEN */
#ifdef __cplusplus
ret->handles = NULL;
ret->src = NULL;
ret->sink = NULL;
- ml_tensors_info_initialize (&ret->tensors_info);
+ _ml_tensors_info_initialize (&ret->tensors_info);
ret->size = 0;
ret->maxid = 0;
ret->handle_id = 0;
guint i, n_caps;
gboolean found = FALSE;
- ml_tensors_info_initialize (info);
+ _ml_tensors_info_initialize (info);
n_caps = gst_caps_get_size (caps);
for (i = 0; i < n_caps; i++) {
found = gst_tensors_config_from_structure (&config, s);
if (found) {
- ml_tensors_info_copy_from_gst (info, &config.info);
+ _ml_tensors_info_copy_from_gst (info, &config.info);
*is_flexible = gst_tensors_config_is_flexible (&config);
break;
}
/* set tensor data */
status =
- ml_tensors_data_create_no_alloc (NULL, (ml_tensors_data_h *) & _data);
+ _ml_tensors_data_create_no_alloc (NULL, (ml_tensors_data_h *) & _data);
if (status != ML_ERROR_NONE) {
_ml_loge ("Failed to allocate memory for tensors data in sink callback.");
return;
}
for (i = 0; i < _info->num_tensors; i++) {
- size_t sz = ml_tensor_info_get_size (&_info->info[i]);
+ size_t sz = _ml_tensor_info_get_size (&_info->info[i]);
/* Not configured, yet. */
if (sz == 0)
_data->tensors[i].size = map[i].size - hsize;
}
- ml_tensors_info_copy_from_gst (_info, &gst_info);
+ _ml_tensors_info_copy_from_gst (_info, &gst_info);
}
/* Iterate e->handles, pass the data to them */
}
if (_data) {
- ml_tensors_data_destroy_internal (_data, FALSE);
+ _ml_tensors_data_destroy_internal (_data, FALSE);
_data = NULL;
}
return;
if (e->sink)
gst_object_unref (e->sink);
- ml_tensors_info_free (&e->tensors_info);
+ _ml_tensors_info_free (&e->tensors_info);
g_mutex_unlock (&e->lock);
g_mutex_clear (&e->lock);
const gchar *element_name = gst_plugin_feature_get_name (feature);
/* validate the availability of the plugin */
- if (!is_internal && ml_check_plugin_availability (plugin_name,
+ if (!is_internal && _ml_check_plugin_availability (plugin_name,
element_name) != ML_ERROR_NONE) {
status = ML_ERROR_NOT_SUPPORTED;
done = TRUE;
/* init null */
*pipe = NULL;
- if ((status = ml_initialize_gstreamer ()) != ML_ERROR_NONE)
+ if ((status = _ml_initialize_gstreamer ()) != ML_ERROR_NONE)
return status;
/* prepare pipeline handle */
if (found && !flexible) {
for (i = 0; i < _info->num_tensors; i++) {
- sz = ml_tensor_info_get_size (&_info->info[i]);
+ sz = _ml_tensor_info_get_size (&_info->info[i]);
elem->size += sz;
}
} else {
}
for (i = 0; i < elem->tensors_info.num_tensors; i++) {
- size_t sz = ml_tensor_info_get_size (&elem->tensors_info.info[i]);
+ size_t sz = _ml_tensor_info_get_size (&elem->tensors_info.info[i]);
if (sz != _data->tensors[i].size) {
_ml_loge
/* Create buffer to be pushed from buf[] */
buffer = gst_buffer_new ();
- ml_tensors_info_copy_from_ml (&gst_info, _data->info);
+ _ml_tensors_info_copy_from_ml (&gst_info, _data->info);
for (i = 0; i < _data->num_tensors; i++) {
mem_data = _data->tensors[i].tensor;
/* Free data ptr if buffer policy is auto-free */
if (policy == ML_PIPELINE_BUF_POLICY_AUTO_FREE) {
G_UNLOCK_UNLESS_NOLOCK (*_data);
- ml_tensors_data_destroy_internal (_data, FALSE);
+ _ml_tensors_data_destroy_internal (_data, FALSE);
_data = NULL;
}
* @brief Gets the element of pipeline itself (GstElement).
*/
GstElement *
-ml_pipeline_get_gst_element (ml_pipeline_h pipe)
+_ml_pipeline_get_gst_element (ml_pipeline_h pipe)
{
ml_pipeline *p = (ml_pipeline *) pipe;
GstElement *element = NULL;
g_mutex_lock (&c->lock);
/* prepare invoke */
- status = ml_tensors_data_create_no_alloc (c->in_info, &in_data);
+ status = _ml_tensors_data_create_no_alloc (c->in_info, &in_data);
if (status != ML_ERROR_NONE)
goto done;
for (i = 0; i < _data->num_tensors; i++)
_data->tensors[i].tensor = in[i].data;
- status = ml_tensors_data_create_no_alloc (c->out_info, &out_data);
+ status = _ml_tensors_data_create_no_alloc (c->out_info, &out_data);
if (status != ML_ERROR_NONE)
goto done;
goto exit;
/* register custom filter */
- ml_tensors_info_copy_from_ml (&in_info, c->in_info);
- ml_tensors_info_copy_from_ml (&out_info, c->out_info);
+ _ml_tensors_info_copy_from_ml (&in_info, c->in_info);
+ _ml_tensors_info_copy_from_ml (&out_info, c->out_info);
if (NNS_custom_easy_register (name, ml_pipeline_custom_invoke, c,
&in_info, &out_info) != 0) {
if (!c || !c->cb)
return FALSE;
- ml_tensors_info_create_from_gst (&ml_info, &in_info);
- status = ml_tensors_data_create_no_alloc (ml_info, &in_data);
+ _ml_tensors_info_create_from_gst (&ml_info, &in_info);
+ status = _ml_tensors_data_create_no_alloc (ml_info, &in_data);
if (status != ML_ERROR_NONE)
goto done;
if (nnfw == ML_NNFW_TYPE_ANY)
return ML_ERROR_INVALID_PARAMETER;
- fw_name = ml_get_nnfw_subplugin_name (nnfw);
+ fw_name = _ml_get_nnfw_subplugin_name (nnfw);
if (fw_name) {
if (nnstreamer_filter_find (fw_name) != NULL) {
- accl_hw accl = ml_nnfw_to_accl_hw (hw);
+ accl_hw accl = _ml_nnfw_to_accl_hw (hw);
if (gst_tensor_filter_check_hw_availability (fw_name, accl, custom)) {
*available = true;
/** memory will be allocated by tensor_filter_single */
in_tensors->tensors[i].tensor = NULL;
in_tensors->tensors[i].size =
- ml_tensor_info_get_size (&single_h->in_info.info[i]);
+ _ml_tensor_info_get_size (&single_h->in_info.info[i]);
}
/** Setup output buffer */
/** memory will be allocated by tensor_filter_single */
out_tensors->tensors[i].tensor = NULL;
out_tensors->tensors[i].size =
- ml_tensor_info_get_size (&single_h->out_info.info[i]);
+ _ml_tensor_info_get_size (&single_h->out_info.info[i]);
}
}
int status = ML_ERROR_NONE;
int ret = -EINVAL;
- ml_tensors_info_copy_from_ml (&gst_in_info, info);
+ _ml_tensors_info_copy_from_ml (&gst_in_info, info);
ret = single_h->klass->set_input_info (single_h->filter, &gst_in_info,
&gst_out_info);
if (ret == 0) {
- ml_tensors_info_copy_from_gst (&single_h->in_info, &gst_in_info);
- ml_tensors_info_copy_from_gst (&single_h->out_info, &gst_out_info);
+ _ml_tensors_info_copy_from_gst (&single_h->in_info, &gst_in_info);
+ _ml_tensors_info_copy_from_gst (&single_h->out_info, &gst_out_info);
__setup_in_out_tensors (single_h);
} else if (ret == -ENOENT) {
status = ML_ERROR_NOT_SUPPORTED;
str_name_name = CONCAT_MACRO_STR (OUTPUT_STR, NAME_STR);
}
- ml_tensors_info_copy_from_ml (&info, tensors_info);
+ _ml_tensors_info_copy_from_ml (&info, tensors_info);
/* Set input option */
str_dim = gst_tensors_info_get_dimensions_string (&info);
ml_tensors_info_h info = NULL;
ml_single_get_gst_info (single_h, is_input, &gst_info);
- ml_tensors_info_create_from_gst (&info, &gst_info);
+ _ml_tensors_info_create_from_gst (&info, &gst_info);
gst_tensors_info_free (&gst_info);
single_h->destroy_data_list = NULL;
single_h->invoking = FALSE;
- ml_tensors_info_initialize (&single_h->in_info);
- ml_tensors_info_initialize (&single_h->out_info);
+ _ml_tensors_info_initialize (&single_h->in_info);
+ _ml_tensors_info_initialize (&single_h->out_info);
g_mutex_init (&single_h->mutex);
g_cond_init (&single_h->cond);
list_models = g_strsplit (info->models, ",", -1);
num_models = g_strv_length (list_models);
- status = ml_validate_model_file ((const char **) list_models, num_models,
+ status = _ml_validate_model_file ((const char **) list_models, num_models,
&nnfw);
if (status != ML_ERROR_NONE) {
g_strfreev (list_models);
* 2. Determine hw
* (Supposed CPU only) Support others later.
*/
- if (!ml_nnfw_is_available (nnfw, hw)) {
+ if (!_ml_nnfw_is_available (nnfw, hw)) {
_ml_loge ("The given nnfw is not available.");
return ML_ERROR_NOT_SUPPORTED;
}
}
/* set accelerator, framework, model files and custom option */
- fw_name = ml_get_nnfw_subplugin_name (nnfw);
- hw_name = ml_nnfw_to_str_prop (hw);
+ fw_name = _ml_get_nnfw_subplugin_name (nnfw);
+ hw_name = _ml_nnfw_to_str_prop (hw);
g_object_set (filter_obj, "framework", fw_name, "accelerator", hw_name,
"model", info->models, NULL);
g_free (hw_name);
single_h->klass = NULL;
}
- ml_tensors_info_free (&single_h->in_info);
- ml_tensors_info_free (&single_h->out_info);
+ _ml_tensors_info_free (&single_h->in_info);
+ _ml_tensors_info_free (&single_h->out_info);
g_cond_clear (&single_h->cond);
g_mutex_clear (&single_h->mutex);
if (need_alloc) {
*output = NULL;
- status = ml_tensors_data_clone_no_alloc (&single_h->out_tensors,
+ status = _ml_tensors_data_clone_no_alloc (&single_h->out_tensors,
&single_h->output);
if (status != ML_ERROR_NONE)
goto exit;
if (num == gst_info.num_tensors) {
ml_tensors_info_h ml_info;
- ml_tensors_info_create_from_gst (&ml_info, &gst_info);
+ _ml_tensors_info_create_from_gst (&ml_info, &gst_info);
/* change configuration */
status = ml_single_set_gst_info (single_h, ml_info);
}
*description =
- ml_replace_string (*description, what, src_name, " !", &changed);
+ _ml_replace_string (*description, what, src_name, " !", &changed);
if (changed > 1) {
/* allow one src in the pipeline */
_ml_loge ("Cannot parse duplicated src node.");
status = ML_ERROR_NOT_SUPPORTED;
goto mm_error;
}
- *result = ml_replace_string (*result, ML_TIZEN_CAM_VIDEO_SRC, src_name,
+ *result = _ml_replace_string (*result, ML_TIZEN_CAM_VIDEO_SRC, src_name,
" !", &changed);
if (changed > 1) {
/* Allow one src only in a pipeline */
status = ML_ERROR_NOT_SUPPORTED;
goto mm_error;
}
- *result = ml_replace_string (*result, ML_TIZEN_CAM_AUDIO_SRC, src_name,
+ *result = _ml_replace_string (*result, ML_TIZEN_CAM_AUDIO_SRC, src_name,
" !", &changed);
if (changed > 1) {
/* Allow one src only in a pipeline */
* @brief Releases the resource handle of Tizen.
*/
void
-ml_tizen_release_resource (gpointer handle, const gchar * res_type)
+_ml_tizen_release_resource (gpointer handle, const gchar * res_type)
{
if (g_str_equal (res_type, TIZEN_RES_MM)) {
ml_tizen_mm_res_release (handle, TRUE);
* @brief Gets the resource handle of Tizen.
*/
int
-ml_tizen_get_resource (ml_pipeline_h pipe, const gchar * res_type)
+_ml_tizen_get_resource (ml_pipeline_h pipe, const gchar * res_type)
{
int status = ML_ERROR_NONE;
* @brief Converts predefined element for Tizen.
*/
int
-ml_tizen_convert_element (ml_pipeline_h pipe, gchar ** result,
+_ml_tizen_convert_element (ml_pipeline_h pipe, gchar ** result,
gboolean is_internal)
{
int status;
#if defined (__FEATURE_CHECK_SUPPORT__)
#define check_feature_state() \
do { \
- int feature_ret = ml_tizen_get_feature_enabled (); \
+ int feature_ret = _ml_tizen_get_feature_enabled (); \
if (ML_ERROR_NONE != feature_ret) \
return feature_ret; \
} while (0);
-#define set_feature_state(...) ml_tizen_set_feature_state(__VA_ARGS__)
+#define set_feature_state(...) _ml_tizen_set_feature_state(__VA_ARGS__)
#else /* __FEATURE_CHECK_SUPPORT__ */
#define check_feature_state()
#define set_feature_state(...)
/**
* @brief Macro to compare the tensors info.
*/
-#define ml_tensors_info_is_equal(i1,i2) ({bool e; (ml_tensors_info_compare ((i1), (i2), &e) == ML_ERROR_NONE && e);})
+#define ml_tensors_info_is_equal(i1,i2) ({bool e; (_ml_tensors_info_compare ((i1), (i2), &e) == ML_ERROR_NONE && e);})
/**
* @brief The function to be called when destroying the allocated handle.
* @brief Gets the byte size of the given tensor info.
* @note This is not thread safe.
*/
-size_t ml_tensor_info_get_size (const ml_tensor_info_s *info);
+size_t _ml_tensor_info_get_size (const ml_tensor_info_s *info);
/**
* @brief Initializes the tensors information with default value.
* @retval #ML_ERROR_NONE Successful
* @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
*/
-int ml_tensors_info_initialize (ml_tensors_info_s *info);
+int _ml_tensors_info_initialize (ml_tensors_info_s *info);
/**
* @brief Frees and initialize the data in tensors info.
* @since_tizen 5.5
* @param[in] info The tensors info pointer to be freed.
*/
-void ml_tensors_info_free (ml_tensors_info_s *info);
+void _ml_tensors_info_free (ml_tensors_info_s *info);
/**
* @brief Creates a tensor data frame without allocating new buffer cloning the given tensors data.
* @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
* @retval #ML_ERROR_OUT_OF_MEMORY Failed to allocate required memory.
*/
-int ml_tensors_data_clone_no_alloc (const ml_tensors_data_s * data_src, ml_tensors_data_h * data);
+int _ml_tensors_data_clone_no_alloc (const ml_tensors_data_s * data_src, ml_tensors_data_h * data);
/**
* @brief Replaces string.
* @param[out] count The count of replaced. Set NULL if it is unnecessary.
* @return Newly allocated string. The returned string should be freed with g_free().
*/
-gchar * ml_replace_string (gchar * source, const gchar * what, const gchar * to, const gchar * delimiters, guint * count);
+gchar * _ml_replace_string (gchar * source, const gchar * what, const gchar * to, const gchar * delimiters, guint * count);
/**
* @brief Compares the given tensors information.
* @retval #ML_ERROR_NOT_SUPPORTED Not supported.
* @retval #ML_ERROR_INVALID_PARAMETER Given parameter is invalid.
*/
-int ml_tensors_info_compare (const ml_tensors_info_h info1, const ml_tensors_info_h info2, bool *equal);
+int _ml_tensors_info_compare (const ml_tensors_info_h info1, const ml_tensors_info_h info2, bool *equal);
/**
* @brief Frees the tensors data handle and its data.
* @param[in] free_data The flag to free the buffers in handle.
* @return @c 0 on success. Otherwise a negative error value.
*/
-int ml_tensors_data_destroy_internal (ml_tensors_data_h data, gboolean free_data);
+int _ml_tensors_data_destroy_internal (ml_tensors_data_h data, gboolean free_data);
/**
* @brief Creates a tensor data frame without buffer with the given tensors information.
* @param[out] data The handle of tensors data.
* @return @c 0 on success. Otherwise a negative error value.
*/
-int ml_tensors_data_create_no_alloc (const ml_tensors_info_h info, ml_tensors_data_h *data);
+int _ml_tensors_data_create_no_alloc (const ml_tensors_info_h info, ml_tensors_data_h *data);
#if defined (__TIZEN__)
/****** TIZEN CHECK FEATURE BEGINS *****/
/**
* @brief Checks whether machine_learning.inference feature is enabled or not.
*/
-int ml_tizen_get_feature_enabled (void);
+int _ml_tizen_get_feature_enabled (void);
/**
* @brief Set the feature status of machine_learning.inference.
* This is only used for Unit test.
*/
-int ml_tizen_set_feature_state (int state);
+int _ml_tizen_set_feature_state (int state);
/****** TIZEN CHECK FEATURE ENDS *****/
#endif /* __TIZEN__ */
}
}
- status = ml_tensors_data_create_no_alloc (_info, data_h);
+ status = _ml_tensors_data_create_no_alloc (_info, data_h);
if (_info != info_h)
ml_tensors_info_destroy (_info);
return FALSE;
}
- return ml_nnfw_is_available (*nnfw, ML_NNFW_HW_ANY);
+ return _ml_nnfw_is_available (*nnfw, ML_NNFW_HW_ANY);
}
/**
gst_android_init (env, context);
} else {
#else
- if (ml_initialize_gstreamer () != ML_ERROR_NONE) {
+ if (_ml_initialize_gstreamer () != ML_ERROR_NONE) {
#endif
nns_loge ("Invalid params, cannot initialize GStreamer.");
goto done;
return FALSE;
}
- ml_tensors_info_free (priv->in_info);
+ _ml_tensors_info_free (priv->in_info);
ml_tensors_info_clone (priv->in_info, in_info);
if (priv->in_info_obj)
}
if (!ml_tensors_info_is_equal (out_info, priv->out_info)) {
- ml_tensors_info_free (priv->out_info);
+ _ml_tensors_info_free (priv->out_info);
ml_tensors_info_clone (priv->out_info, out_info);
}
return FALSE;
}
- ml_tensors_info_free (priv->out_info);
+ _ml_tensors_info_free (priv->out_info);
ml_tensors_info_clone (priv->out_info, out_info);
if (priv->out_info_obj)
nns_native_check_element_availability (JNIEnv * env, jclass clazz, jstring name)
{
const char *element_name = (*env)->GetStringUTFChars (env, name, NULL);
- jboolean res = ml_element_is_available (element_name) ? JNI_TRUE : JNI_FALSE;
+ jboolean res = _ml_element_is_available (element_name) ? JNI_TRUE : JNI_FALSE;
(*env)->ReleaseStringUTFChars (env, name, element_name);
return res;
}
if (!ml_tensors_info_is_equal (in_info, priv->in_info)) {
- ml_tensors_info_free (priv->in_info);
+ _ml_tensors_info_free (priv->in_info);
ml_tensors_info_clone (priv->in_info, in_info);
}
goto done;
}
- ml_tensors_info_free (priv->out_info);
+ _ml_tensors_info_free (priv->out_info);
ml_tensors_info_clone (priv->out_info, out_info);
if (priv->out_info_obj)
{
int status;
- status = ml_check_plugin_availability (NULL, "tensor_filter");
+ status = _ml_check_plugin_availability (NULL, "tensor_filter");
EXPECT_NE (status, ML_ERROR_NONE);
}
{
int status;
- status = ml_check_plugin_availability (NULL, "tensor_filter");
+ status = _ml_check_plugin_availability (NULL, "tensor_filter");
EXPECT_NE (status, ML_ERROR_NONE);
}
TEST (nnstreamer_capi_util, info_create_2_n)
{
ml_tensors_info_h i;
- int status = ml_tensors_info_create_from_gst (&i, nullptr);
+ int status = _ml_tensors_info_create_from_gst (&i, nullptr);
ASSERT_EQ (status, ML_ERROR_INVALID_PARAMETER);
}
TEST (nnstreamer_capi_util, info_create_3_n)
{
GstTensorsInfo gi;
- int status = ml_tensors_info_create_from_gst (nullptr, &gi);
+ int status = _ml_tensors_info_create_from_gst (nullptr, &gi);
ASSERT_EQ (status, ML_ERROR_INVALID_PARAMETER);
}
*/
TEST (nnstreamer_capi_util, info_init_n)
{
- int status = ml_tensors_info_initialize (nullptr);
+ int status = _ml_tensors_info_initialize (nullptr);
ASSERT_EQ (status, ML_ERROR_INVALID_PARAMETER);
}
ml_tensors_info_set_tensor_type (info, 0, ML_TENSOR_TYPE_UINT8);
ml_tensors_info_set_tensor_dimension (info, 0, dim);
- status = ml_tensors_info_compare (nullptr, info, &equal);
+ status = _ml_tensors_info_compare (nullptr, info, &equal);
ASSERT_EQ (status, ML_ERROR_INVALID_PARAMETER);
status = ml_tensors_info_destroy (info);
ml_tensors_info_set_tensor_type (info, 0, ML_TENSOR_TYPE_UINT8);
ml_tensors_info_set_tensor_dimension (info, 0, dim);
- status = ml_tensors_info_compare (info, nullptr, &equal);
+ status = _ml_tensors_info_compare (info, nullptr, &equal);
ASSERT_EQ (status, ML_ERROR_INVALID_PARAMETER);
status = ml_tensors_info_destroy (info);
ml_tensors_info_set_tensor_type (info2, 0, ML_TENSOR_TYPE_UINT8);
ml_tensors_info_set_tensor_dimension (info2, 0, dim);
- status = ml_tensors_info_compare (info1, info2, nullptr);
+ status = _ml_tensors_info_compare (info1, info2, nullptr);
ASSERT_EQ (status, ML_ERROR_INVALID_PARAMETER);
status = ml_tensors_info_destroy (info1);
is = (ml_tensors_info_s *)info2;
is->num_tensors = 2;
- status = ml_tensors_info_compare (info1, info2, &equal);
+ status = _ml_tensors_info_compare (info1, info2, &equal);
ASSERT_EQ (status, ML_ERROR_NONE);
ASSERT_FALSE (equal);
{
int status;
- status = ml_tensors_data_create_no_alloc (NULL, NULL);
+ status = _ml_tensors_data_create_no_alloc (NULL, NULL);
EXPECT_NE (status, ML_ERROR_NONE);
}
*/
TEST (nnstreamer_capi_util, nnfw_name_01_p)
{
- EXPECT_STREQ (ml_get_nnfw_subplugin_name (ML_NNFW_TYPE_TENSORFLOW_LITE), "tensorflow-lite");
- EXPECT_EQ (ml_get_nnfw_type_by_subplugin_name ("tensorflow-lite"), ML_NNFW_TYPE_TENSORFLOW_LITE);
- EXPECT_STREQ (ml_get_nnfw_subplugin_name (ML_NNFW_TYPE_TENSORFLOW), "tensorflow");
- EXPECT_EQ (ml_get_nnfw_type_by_subplugin_name ("tensorflow"), ML_NNFW_TYPE_TENSORFLOW);
- EXPECT_STREQ (ml_get_nnfw_subplugin_name (ML_NNFW_TYPE_NNFW), "nnfw");
- EXPECT_EQ (ml_get_nnfw_type_by_subplugin_name ("nnfw"), ML_NNFW_TYPE_NNFW);
- EXPECT_STREQ (ml_get_nnfw_subplugin_name (ML_NNFW_TYPE_VIVANTE), "vivante");
- EXPECT_EQ (ml_get_nnfw_type_by_subplugin_name ("vivante"), ML_NNFW_TYPE_VIVANTE);
- EXPECT_STREQ (ml_get_nnfw_subplugin_name (ML_NNFW_TYPE_SNAP), "snap");
- EXPECT_EQ (ml_get_nnfw_type_by_subplugin_name ("snap"), ML_NNFW_TYPE_SNAP);
+ EXPECT_STREQ (_ml_get_nnfw_subplugin_name (ML_NNFW_TYPE_TENSORFLOW_LITE), "tensorflow-lite");
+ EXPECT_EQ (_ml_get_nnfw_type_by_subplugin_name ("tensorflow-lite"), ML_NNFW_TYPE_TENSORFLOW_LITE);
+ EXPECT_STREQ (_ml_get_nnfw_subplugin_name (ML_NNFW_TYPE_TENSORFLOW), "tensorflow");
+ EXPECT_EQ (_ml_get_nnfw_type_by_subplugin_name ("tensorflow"), ML_NNFW_TYPE_TENSORFLOW);
+ EXPECT_STREQ (_ml_get_nnfw_subplugin_name (ML_NNFW_TYPE_NNFW), "nnfw");
+ EXPECT_EQ (_ml_get_nnfw_type_by_subplugin_name ("nnfw"), ML_NNFW_TYPE_NNFW);
+ EXPECT_STREQ (_ml_get_nnfw_subplugin_name (ML_NNFW_TYPE_VIVANTE), "vivante");
+ EXPECT_EQ (_ml_get_nnfw_type_by_subplugin_name ("vivante"), ML_NNFW_TYPE_VIVANTE);
+ EXPECT_STREQ (_ml_get_nnfw_subplugin_name (ML_NNFW_TYPE_SNAP), "snap");
+ EXPECT_EQ (_ml_get_nnfw_type_by_subplugin_name ("snap"), ML_NNFW_TYPE_SNAP);
}
/**
*/
TEST (nnstreamer_capi_util, nnfw_name_02_n)
{
- EXPECT_EQ (ml_get_nnfw_type_by_subplugin_name ("invalid-fw"), ML_NNFW_TYPE_ANY);
- EXPECT_EQ (ml_get_nnfw_type_by_subplugin_name (NULL), ML_NNFW_TYPE_ANY);
+ EXPECT_EQ (_ml_get_nnfw_type_by_subplugin_name ("invalid-fw"), ML_NNFW_TYPE_ANY);
+ EXPECT_EQ (_ml_get_nnfw_type_by_subplugin_name (NULL), ML_NNFW_TYPE_ANY);
}
/**
ml_tensors_info_set_tensor_dimension (in_info, 0, in_dim);
/* handle null data */
- status = ml_tensors_data_create_no_alloc (in_info, &input);
+ status = _ml_tensors_data_create_no_alloc (in_info, &input);
EXPECT_EQ (status, ML_ERROR_NONE);
status = ml_single_invoke (single, input, &output);
}
/**
- * @brief Test for internal function 'ml_tensors_info_copy_from_gst'.
+ * @brief Test for internal function '_ml_tensors_info_copy_from_gst'.
*/
TEST (nnstreamer_capi_internal, copy_from_gst)
{
status = ml_tensors_info_create (&ml_info);
EXPECT_EQ (status, ML_ERROR_NONE);
- ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
+ _ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
status = ml_tensors_info_get_count (ml_info, &count);
EXPECT_EQ (status, ML_ERROR_NONE);
EXPECT_EQ (count, 2U);
gst_info.info[0].type = _NNS_INT32;
gst_info.info[1].type = _NNS_UINT32;
- ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
+ _ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
status = ml_tensors_info_get_tensor_type (ml_info, 0, &type);
EXPECT_EQ (status, ML_ERROR_NONE);
EXPECT_EQ (type, ML_TENSOR_TYPE_INT32);
gst_info.info[0].type = _NNS_INT16;
gst_info.info[1].type = _NNS_UINT16;
- ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
+ _ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
status = ml_tensors_info_get_tensor_type (ml_info, 0, &type);
EXPECT_EQ (status, ML_ERROR_NONE);
EXPECT_EQ (type, ML_TENSOR_TYPE_INT16);
gst_info.info[0].type = _NNS_INT8;
gst_info.info[1].type = _NNS_UINT8;
- ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
+ _ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
status = ml_tensors_info_get_tensor_type (ml_info, 0, &type);
EXPECT_EQ (status, ML_ERROR_NONE);
EXPECT_EQ (type, ML_TENSOR_TYPE_INT8);
gst_info.info[0].type = _NNS_INT64;
gst_info.info[1].type = _NNS_UINT64;
- ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
+ _ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
status = ml_tensors_info_get_tensor_type (ml_info, 0, &type);
EXPECT_EQ (status, ML_ERROR_NONE);
EXPECT_EQ (type, ML_TENSOR_TYPE_INT64);
gst_info.info[0].type = _NNS_FLOAT64;
gst_info.info[1].type = _NNS_FLOAT32;
- ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
+ _ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
status = ml_tensors_info_get_tensor_type (ml_info, 0, &type);
EXPECT_EQ (status, ML_ERROR_NONE);
EXPECT_EQ (type, ML_TENSOR_TYPE_FLOAT64);
gst_info.info[0].name = g_strdup ("tn1");
gst_info.info[1].name = g_strdup ("tn2");
- ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
+ _ml_tensors_info_copy_from_gst ((ml_tensors_info_s *)ml_info, &gst_info);
status = ml_tensors_info_get_tensor_name (ml_info, 0, &name);
EXPECT_EQ (status, ML_ERROR_NONE);
EXPECT_STREQ (name, "tn1");
}
/**
- * @brief Test for internal function 'ml_tensors_info_copy_from_ml'.
+ * @brief Test for internal function '_ml_tensors_info_copy_from_ml'.
*/
TEST (nnstreamer_capi_internal, copy_from_ml)
{
status = ml_tensors_info_set_tensor_dimension (ml_info, 1, dim);
EXPECT_EQ (status, ML_ERROR_NONE);
- ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
+ _ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
EXPECT_EQ (gst_info.num_tensors, 2U);
EXPECT_EQ (gst_info.info[0].dimension[0], 1U);
EXPECT_EQ (gst_info.info[0].dimension[1], 2U);
EXPECT_EQ (status, ML_ERROR_NONE);
status = ml_tensors_info_set_tensor_type (ml_info, 1, ML_TENSOR_TYPE_UINT32);
EXPECT_EQ (status, ML_ERROR_NONE);
- ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
+ _ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
EXPECT_EQ (gst_info.info[0].type, _NNS_INT32);
EXPECT_EQ (gst_info.info[1].type, _NNS_UINT32);
EXPECT_EQ (status, ML_ERROR_NONE);
status = ml_tensors_info_set_tensor_type (ml_info, 1, ML_TENSOR_TYPE_UINT16);
EXPECT_EQ (status, ML_ERROR_NONE);
- ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
+ _ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
EXPECT_EQ (gst_info.info[0].type, _NNS_INT16);
EXPECT_EQ (gst_info.info[1].type, _NNS_UINT16);
EXPECT_EQ (status, ML_ERROR_NONE);
status = ml_tensors_info_set_tensor_type (ml_info, 1, ML_TENSOR_TYPE_UINT8);
EXPECT_EQ (status, ML_ERROR_NONE);
- ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
+ _ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
EXPECT_EQ (gst_info.info[0].type, _NNS_INT8);
EXPECT_EQ (gst_info.info[1].type, _NNS_UINT8);
EXPECT_EQ (status, ML_ERROR_NONE);
status = ml_tensors_info_set_tensor_type (ml_info, 1, ML_TENSOR_TYPE_UINT64);
EXPECT_EQ (status, ML_ERROR_NONE);
- ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
+ _ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
EXPECT_EQ (gst_info.info[0].type, _NNS_INT64);
EXPECT_EQ (gst_info.info[1].type, _NNS_UINT64);
EXPECT_EQ (status, ML_ERROR_NONE);
status = ml_tensors_info_set_tensor_type (ml_info, 1, ML_TENSOR_TYPE_FLOAT32);
EXPECT_EQ (status, ML_ERROR_NONE);
- ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
+ _ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
EXPECT_EQ (gst_info.info[0].type, _NNS_FLOAT64);
EXPECT_EQ (gst_info.info[1].type, _NNS_FLOAT32);
EXPECT_EQ (status, ML_ERROR_NONE);
status = ml_tensors_info_set_tensor_name (ml_info, 1, "tn2");
EXPECT_EQ (status, ML_ERROR_NONE);
- ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
+ _ml_tensors_info_copy_from_ml (&gst_info, (ml_tensors_info_s *)ml_info);
EXPECT_STREQ (gst_info.info[0].name, "tn1");
EXPECT_STREQ (gst_info.info[1].name, "tn2");
}
/**
- * @brief Test for internal function 'ml_validate_model_file'.
+ * @brief Test for internal function '_ml_validate_model_file'.
* @detail Invalid params.
*/
TEST (nnstreamer_capi_internal, validate_model_file_01_n)
goto skip_test;
}
- status = ml_validate_model_file (NULL, 1, &nnfw);
+ status = _ml_validate_model_file (NULL, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
- status = ml_validate_model_file (&test_model, 0, &nnfw);
+ status = _ml_validate_model_file (&test_model, 0, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
- status = ml_validate_model_file (&test_model, 1, NULL);
+ status = _ml_validate_model_file (&test_model, 1, NULL);
EXPECT_NE (status, ML_ERROR_NONE);
skip_test:
}
/**
- * @brief Test for internal function 'ml_validate_model_file'.
+ * @brief Test for internal function '_ml_validate_model_file'.
* @detail Invalid file extension.
*/
TEST (nnstreamer_capi_internal, validate_model_file_02_n)
test_models[1] = test_model2;
nnfw = ML_NNFW_TYPE_CUSTOM_FILTER;
- status = ml_validate_model_file (&test_model2, 1, &nnfw);
+ status = _ml_validate_model_file (&test_model2, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
nnfw = ML_NNFW_TYPE_TENSORFLOW_LITE;
- status = ml_validate_model_file (&test_model1, 1, &nnfw);
+ status = _ml_validate_model_file (&test_model1, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
nnfw = ML_NNFW_TYPE_TENSORFLOW;
- status = ml_validate_model_file (&test_model2, 1, &nnfw);
+ status = _ml_validate_model_file (&test_model2, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
/* snap only for android */
nnfw = ML_NNFW_TYPE_SNAP;
- status = ml_validate_model_file (&test_model1, 1, &nnfw);
+ status = _ml_validate_model_file (&test_model1, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
nnfw = ML_NNFW_TYPE_VIVANTE;
- status = ml_validate_model_file (test_models, 1, &nnfw);
+ status = _ml_validate_model_file (test_models, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
/** @todo currently mvnc, openvino and edgetpu always return failure */
nnfw = ML_NNFW_TYPE_MVNC;
- status = ml_validate_model_file (&test_model1, 1, &nnfw);
+ status = _ml_validate_model_file (&test_model1, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
nnfw = ML_NNFW_TYPE_OPENVINO;
- status = ml_validate_model_file (&test_model1, 1, &nnfw);
+ status = _ml_validate_model_file (&test_model1, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
nnfw = ML_NNFW_TYPE_EDGE_TPU;
- status = ml_validate_model_file (&test_model1, 1, &nnfw);
+ status = _ml_validate_model_file (&test_model1, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
nnfw = ML_NNFW_TYPE_ARMNN;
- status = ml_validate_model_file (&test_model1, 1, &nnfw);
+ status = _ml_validate_model_file (&test_model1, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
skip_test:
}
/**
- * @brief Test for internal function 'ml_validate_model_file'.
+ * @brief Test for internal function '_ml_validate_model_file'.
* @detail Invalid model path.
*/
TEST (nnstreamer_capi_internal, validate_model_file_03_n)
test_dir2 = g_build_filename (test_dir1, "invaliddir", NULL);
nnfw = ML_NNFW_TYPE_TENSORFLOW_LITE;
- status = ml_validate_model_file (&test_dir1, 1, &nnfw);
+ status = _ml_validate_model_file (&test_dir1, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
nnfw = ML_NNFW_TYPE_TENSORFLOW;
- status = ml_validate_model_file (&test_dir1, 1, &nnfw);
+ status = _ml_validate_model_file (&test_dir1, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
nnfw = ML_NNFW_TYPE_NNFW;
- status = ml_validate_model_file (&test_dir2, 1, &nnfw);
+ status = _ml_validate_model_file (&test_dir2, 1, &nnfw);
EXPECT_NE (status, ML_ERROR_NONE);
#ifdef ENABLE_NNFW_RUNTIME
/* only NNFW supports dir path */
nnfw = ML_NNFW_TYPE_NNFW;
- status = ml_validate_model_file (&test_dir1, 1, &nnfw);
+ status = _ml_validate_model_file (&test_dir1, 1, &nnfw);
EXPECT_EQ (status, ML_ERROR_NONE);
#endif