Skip to content

Commit 769d16e

Browse files
authored
wasi-nn: move some host-only things out of wasi_nn_types.h (#4334)
cf. #4324
1 parent 350af77 commit 769d16e

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

core/iwasm/libraries/wasi-nn/include/wasi_nn_types.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -131,35 +131,6 @@ typedef uint32_t graph_execution_context;
131131

132132
/* Definition of 'wasi_nn.h' structs in WASM app format (using offset) */
133133

134-
typedef wasi_nn_error (*LOAD)(void *, graph_builder_array *, graph_encoding,
135-
execution_target, graph *);
136-
typedef wasi_nn_error (*LOAD_BY_NAME)(void *, const char *, uint32_t, graph *);
137-
typedef wasi_nn_error (*LOAD_BY_NAME_WITH_CONFIG)(void *, const char *,
138-
uint32_t, void *, uint32_t,
139-
graph *);
140-
typedef wasi_nn_error (*INIT_EXECUTION_CONTEXT)(void *, graph,
141-
graph_execution_context *);
142-
typedef wasi_nn_error (*SET_INPUT)(void *, graph_execution_context, uint32_t,
143-
tensor *);
144-
typedef wasi_nn_error (*COMPUTE)(void *, graph_execution_context);
145-
typedef wasi_nn_error (*GET_OUTPUT)(void *, graph_execution_context, uint32_t,
146-
tensor_data, uint32_t *);
147-
/* wasi-nn general APIs */
148-
typedef wasi_nn_error (*BACKEND_INITIALIZE)(void **);
149-
typedef wasi_nn_error (*BACKEND_DEINITIALIZE)(void *);
150-
151-
typedef struct {
152-
LOAD load;
153-
LOAD_BY_NAME load_by_name;
154-
LOAD_BY_NAME_WITH_CONFIG load_by_name_with_config;
155-
INIT_EXECUTION_CONTEXT init_execution_context;
156-
SET_INPUT set_input;
157-
COMPUTE compute;
158-
GET_OUTPUT get_output;
159-
BACKEND_INITIALIZE init;
160-
BACKEND_DEINITIALIZE deinit;
161-
} api_function;
162-
163134
#ifdef __cplusplus
164135
}
165136
#endif

core/iwasm/libraries/wasi-nn/src/wasi_nn_private.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,33 @@ typedef struct {
1515
void *backend_ctx;
1616
} WASINNContext;
1717

18+
typedef wasi_nn_error (*LOAD)(void *, graph_builder_array *, graph_encoding,
19+
execution_target, graph *);
20+
typedef wasi_nn_error (*LOAD_BY_NAME)(void *, const char *, uint32_t, graph *);
21+
typedef wasi_nn_error (*LOAD_BY_NAME_WITH_CONFIG)(void *, const char *,
22+
uint32_t, void *, uint32_t,
23+
graph *);
24+
typedef wasi_nn_error (*INIT_EXECUTION_CONTEXT)(void *, graph,
25+
graph_execution_context *);
26+
typedef wasi_nn_error (*SET_INPUT)(void *, graph_execution_context, uint32_t,
27+
tensor *);
28+
typedef wasi_nn_error (*COMPUTE)(void *, graph_execution_context);
29+
typedef wasi_nn_error (*GET_OUTPUT)(void *, graph_execution_context, uint32_t,
30+
tensor_data, uint32_t *);
31+
/* wasi-nn general APIs */
32+
typedef wasi_nn_error (*BACKEND_INITIALIZE)(void **);
33+
typedef wasi_nn_error (*BACKEND_DEINITIALIZE)(void *);
34+
35+
typedef struct {
36+
LOAD load;
37+
LOAD_BY_NAME load_by_name;
38+
LOAD_BY_NAME_WITH_CONFIG load_by_name_with_config;
39+
INIT_EXECUTION_CONTEXT init_execution_context;
40+
SET_INPUT set_input;
41+
COMPUTE compute;
42+
GET_OUTPUT get_output;
43+
BACKEND_INITIALIZE init;
44+
BACKEND_DEINITIALIZE deinit;
45+
} api_function;
46+
1847
#endif

0 commit comments

Comments
 (0)