Просмотр исходного кода

wasi-nn: move some host-only things out of wasi_nn_types.h (#4334)

cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4324
YAMAMOTO Takashi 7 месяцев назад
Родитель
Сommit
769d16eaab

+ 0 - 29
core/iwasm/libraries/wasi-nn/include/wasi_nn_types.h

@@ -131,35 +131,6 @@ typedef uint32_t graph_execution_context;
 
 /* Definition of 'wasi_nn.h' structs in WASM app format (using offset) */
 
-typedef wasi_nn_error (*LOAD)(void *, graph_builder_array *, graph_encoding,
-                              execution_target, graph *);
-typedef wasi_nn_error (*LOAD_BY_NAME)(void *, const char *, uint32_t, graph *);
-typedef wasi_nn_error (*LOAD_BY_NAME_WITH_CONFIG)(void *, const char *,
-                                                  uint32_t, void *, uint32_t,
-                                                  graph *);
-typedef wasi_nn_error (*INIT_EXECUTION_CONTEXT)(void *, graph,
-                                                graph_execution_context *);
-typedef wasi_nn_error (*SET_INPUT)(void *, graph_execution_context, uint32_t,
-                                   tensor *);
-typedef wasi_nn_error (*COMPUTE)(void *, graph_execution_context);
-typedef wasi_nn_error (*GET_OUTPUT)(void *, graph_execution_context, uint32_t,
-                                    tensor_data, uint32_t *);
-/* wasi-nn general APIs */
-typedef wasi_nn_error (*BACKEND_INITIALIZE)(void **);
-typedef wasi_nn_error (*BACKEND_DEINITIALIZE)(void *);
-
-typedef struct {
-    LOAD load;
-    LOAD_BY_NAME load_by_name;
-    LOAD_BY_NAME_WITH_CONFIG load_by_name_with_config;
-    INIT_EXECUTION_CONTEXT init_execution_context;
-    SET_INPUT set_input;
-    COMPUTE compute;
-    GET_OUTPUT get_output;
-    BACKEND_INITIALIZE init;
-    BACKEND_DEINITIALIZE deinit;
-} api_function;
-
 #ifdef __cplusplus
 }
 #endif

+ 29 - 0
core/iwasm/libraries/wasi-nn/src/wasi_nn_private.h

@@ -15,4 +15,33 @@ typedef struct {
     void *backend_ctx;
 } WASINNContext;
 
+typedef wasi_nn_error (*LOAD)(void *, graph_builder_array *, graph_encoding,
+                              execution_target, graph *);
+typedef wasi_nn_error (*LOAD_BY_NAME)(void *, const char *, uint32_t, graph *);
+typedef wasi_nn_error (*LOAD_BY_NAME_WITH_CONFIG)(void *, const char *,
+                                                  uint32_t, void *, uint32_t,
+                                                  graph *);
+typedef wasi_nn_error (*INIT_EXECUTION_CONTEXT)(void *, graph,
+                                                graph_execution_context *);
+typedef wasi_nn_error (*SET_INPUT)(void *, graph_execution_context, uint32_t,
+                                   tensor *);
+typedef wasi_nn_error (*COMPUTE)(void *, graph_execution_context);
+typedef wasi_nn_error (*GET_OUTPUT)(void *, graph_execution_context, uint32_t,
+                                    tensor_data, uint32_t *);
+/* wasi-nn general APIs */
+typedef wasi_nn_error (*BACKEND_INITIALIZE)(void **);
+typedef wasi_nn_error (*BACKEND_DEINITIALIZE)(void *);
+
+typedef struct {
+    LOAD load;
+    LOAD_BY_NAME load_by_name;
+    LOAD_BY_NAME_WITH_CONFIG load_by_name_with_config;
+    INIT_EXECUTION_CONTEXT init_execution_context;
+    SET_INPUT set_input;
+    COMPUTE compute;
+    GET_OUTPUT get_output;
+    BACKEND_INITIALIZE init;
+    BACKEND_DEINITIALIZE deinit;
+} api_function;
+
 #endif