From: 이상규/On-Device Lab(SR)/Principal Engineer/삼성전자 Date: Mon, 12 Aug 2019 07:50:00 +0000 (+0900) Subject: [neurun] Use nnfw api wrapper's return value (#6493) X-Git-Tag: accepted/tizen/unified/20190903.052428~472 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=17feede4ac1cf2684375e207358489c314821a03;p=platform%2Fcore%2Fml%2Fnnfw.git [neurun] Use nnfw api wrapper's return value (#6493) Currently nnfw implementation returns no error. Now, it will use the return value of wrapper. Signed-off-by: Sanggyu Lee --- diff --git a/runtimes/neurun/frontend/api/nnfw_dev.cc b/runtimes/neurun/frontend/api/nnfw_dev.cc index 584a1e3..16f9667 100644 --- a/runtimes/neurun/frontend/api/nnfw_dev.cc +++ b/runtimes/neurun/frontend/api/nnfw_dev.cc @@ -51,8 +51,7 @@ NNFW_STATUS nnfw_close_session(nnfw_session *session) */ NNFW_STATUS nnfw_load_model_from_file(nnfw_session *session, const char *pacakge_file_path) { - session->load_model_from_file(pacakge_file_path); - return NNFW_STATUS_NO_ERROR; + return session->load_model_from_file(pacakge_file_path); } /* @@ -62,11 +61,7 @@ NNFW_STATUS nnfw_load_model_from_file(nnfw_session *session, const char *pacakge * @param session the session to be prepared * @return NNFW_STATUS_NO_ERROR if successful */ -NNFW_STATUS nnfw_prepare(nnfw_session *session) -{ - session->prepare(); - return NNFW_STATUS_NO_ERROR; -} +NNFW_STATUS nnfw_prepare(nnfw_session *session) { return session->prepare(); } /* * Run inference @@ -74,11 +69,7 @@ NNFW_STATUS nnfw_prepare(nnfw_session *session) * @param session the session to run inference * @return NNFW_STATUS_NO_ERROR if successful */ -NNFW_STATUS nnfw_run(nnfw_session *session) -{ - session->run(); - return NNFW_STATUS_NO_ERROR; -} +NNFW_STATUS nnfw_run(nnfw_session *session) { return session->run(); } /* * Set input @@ -95,8 +86,7 @@ NNFW_STATUS nnfw_run(nnfw_session *session) NNFW_STATUS nnfw_set_input(nnfw_session *session, int index, NNFW_TYPE type, const void *buffer, size_t length) { - session->set_input(index, type, buffer, length); - return NNFW_STATUS_NO_ERROR; + return session->set_input(index, type, buffer, length); } /* @@ -114,6 +104,5 @@ NNFW_STATUS nnfw_set_input(nnfw_session *session, int index, NNFW_TYPE type, con NNFW_STATUS nnfw_set_output(nnfw_session *session, int index, NNFW_TYPE type, void *buffer, size_t length) { - session->set_output(index, type, buffer, length); - return NNFW_STATUS_NO_ERROR; + return session->set_output(index, type, buffer, length); }