throw std::invalid_argument (err_msg);
}
- assert (model_path == nullptr);
-
model_path = g_strdup (prop->model_files[0]);
container = zdl::DlContainer::IDlContainer::open (model_path);
void
snpe_subplugin::invoke (const GstTensorMemory *input, GstTensorMemory *output)
{
- assert (!empty_model);
- assert (snpe);
-
#if (DBG)
gint64 start_time = g_get_real_time ();
#endif
GstTensorInfo *_info;
+ if (!input)
+ throw std::runtime_error ("Invalid input buffer, it is NULL.");
+ if (!output)
+ throw std::runtime_error ("Invalid output buffer, it is NULL.");
+
if (use_user_buffer) {
for (unsigned int i = 0; i < inputInfo.num_tensors; ++i) {
_info = gst_tensors_info_get_nth_info (std::addressof (inputInfo), i);
ret = sp->open (&prop, &data);
EXPECT_EQ (ret, 0);
- /* catching assertion error */
- EXPECT_DEATH (sp->invoke (NULL, NULL, data, NULL, &output), "");
- EXPECT_DEATH (sp->invoke (NULL, NULL, data, &input, NULL), "");
+ /* catching exception */
+ EXPECT_NE (sp->invoke (NULL, NULL, data, NULL, &output), 0);
+ EXPECT_NE (sp->invoke (NULL, NULL, data, &input, NULL), 0);
g_free (input.data);
g_free (output.data);