[Main] Make main() call N2's init/exit functions.
authorDongju Chae <dongju.chae@samsung.com>
Tue, 16 Jul 2019 11:34:24 +0000 (20:34 +0900)
committer함명주/On-Device Lab(SR)/Principal Engineer/삼성전자 <myungjoo.ham@samsung.com>
Wed, 17 Jul 2019 11:08:55 +0000 (20:08 +0900)
This commit changes main() to call N2's init/exit functions.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
core/npu-engine/src/main.c

index 6491e71..62fcaa4 100644 (file)
@@ -18,6 +18,7 @@
 #include <sys/stat.h>
 #include <string.h>
 
+#include "ne-handler.h"
 #include "ne-conf.h"
 
 static const char *helpmsg = "\
@@ -98,10 +99,19 @@ int main (int argc, char **argv) {
   }
 
   /** @todo NYI Start up required modules (ne-*) */
+  if (init_ne_handler() < 0) {
+    fprintf(stderr, "Fail to init NE host handler\n");
+    return 1;
+  }
 
   while (1) {
     /** @todo NYI Health checks for threads and device adaptations? */
     usleep(200000L);
+
+    /** @todo add some break condition */
   }
+
+  exit_ne_handler();
+
   return 0;
 }