if (*private_data != NULL) {
pdata = *private_data;
- if (strcmp (prop->model_file, pdata->model_path)) {
+ if (g_strcmp0 (prop->model_file, pdata->model_path)) {
nnfw_close (prop, private_data); /* "reopen" */
} else {
return 1;
if (*private_data != NULL) {
py = *private_data;
- if (strcmp (prop->model_file, py_core_getScriptPath (py->py_private_data))) {
+ if (g_strcmp0 (prop->model_file, py_core_getScriptPath (py->py_private_data))) {
py_close (prop, private_data);
} else {
return 1;
gboolean torch_use_gpu;
if (*private_data != NULL) {
torch = *private_data;
- if (strcmp (prop->model_file,
+ if (g_strcmp0 (prop->model_file,
torch_core_getModelPath (torch->torch_private_data))) {
torch_close (prop, private_data);
} else {
if (*private_data != NULL) {
tf = *private_data;
- if (strcmp (prop->model_file, tf_core_getModelPath (tf->tf_private_data))) {
+ if (g_strcmp0 (prop->model_file, tf_core_getModelPath (tf->tf_private_data))) {
tf_close (prop, private_data);
} else {
return 1;
{
tflite_data *tf;
nnapi_hw hw = NNAPI_UNKNOWN;
+
if (prop->nnapi) {
gchar **strv = NULL;
+ guint len;
+
strv = g_strsplit (prop->nnapi, ":", 2);
- if (!g_strcmp0 (strv[0], "true") && g_strv_length (strv) >= 2) {
- hw = get_nnapi_hw_type (strv[1]);
- } else if (!g_strcmp0 (strv[0], "true") && g_strv_length (strv) == 1) {
- /** defalut hw for nnapi is CPU */
- hw = NNAPI_CPU;
+ len = g_strv_length (strv);
+
+ if (!g_ascii_strcasecmp (strv[0], "true")) {
+ if (len >= 2) {
+ hw = get_nnapi_hw_type (strv[1]);
+ } else {
+ /** defalut hw for nnapi is CPU */
+ hw = NNAPI_CPU;
+ }
}
+
+ g_strfreev (strv);
}
if (*private_data != NULL) {
/** @todo : Check the integrity of filter->data and filter->model_file, nnfw */
tf = *private_data;
- if (strcmp (prop->model_file,
+ if (g_strcmp0 (prop->model_file,
tflite_core_getModelPath (tf->tflite_private_data))) {
tflite_close (prop, private_data);
} else {