@@ -545,7 +545,7 @@ typedef struct WASMModuleInstMemConsumption {
545545 uint32 exports_size ;
546546} WASMModuleInstMemConsumption ;
547547
548- #if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
548+ #if WASM_ENABLE_WASI_NN != 0 || WASM_ENABLE_WASI_EPHEMERAL_NN != 0
549549typedef struct WASINNGlobalContext {
550550 char * encoding ;
551551 char * target ;
@@ -623,29 +623,29 @@ WASMExecEnv *
623623wasm_runtime_get_exec_env_tls (void );
624624#endif
625625
626- #if ( WASM_ENABLE_WASI_EPHEMERAL_NN != 0 )
627- struct wasi_nn_graph_registry {
626+ #if WASM_ENABLE_WASI_NN != 0 || WASM_ENABLE_WASI_EPHEMERAL_NN != 0
627+ typedef struct WASINNArguments {
628628 char * encoding ;
629629 char * target ;
630630
631631 char * * graph_paths ;
632632 uint32_t n_graphs ;
633- };
633+ } WASINNArguments ;
634634
635635WASM_RUNTIME_API_EXTERN int
636- wasi_nn_graph_registry_create (struct wasi_nn_graph_registry * * registryp );
636+ wasi_nn_graph_registry_create (WASINNArguments * * registryp );
637637
638638WASM_RUNTIME_API_EXTERN void
639- wasi_nn_graph_registry_destroy (struct wasi_nn_graph_registry * registry );
639+ wasi_nn_graph_registry_destroy (WASINNArguments * registry );
640640#endif
641641
642642struct InstantiationArgs2 {
643643 InstantiationArgs v1 ;
644644#if WASM_ENABLE_LIBC_WASI != 0
645645 WASIArguments wasi ;
646646#endif
647- #if ( WASM_ENABLE_WASI_EPHEMERAL_NN != 0 )
648- struct wasi_nn_graph_registry nn_registry ;
647+ #if WASM_ENABLE_WASI_NN != 0 || WASM_ENABLE_WASI_EPHEMERAL_NN != 0
648+ WASINNArguments nn_registry ;
649649#endif
650650};
651651
@@ -805,15 +805,15 @@ wasm_runtime_instantiation_args_set_wasi_ns_lookup_pool(
805805 struct InstantiationArgs2 * p , const char * ns_lookup_pool [],
806806 uint32 ns_lookup_pool_size );
807807
808- #if ( WASM_ENABLE_WASI_EPHEMERAL_NN != 0 )
808+ #if WASM_ENABLE_WASI_NN != 0 || WASM_ENABLE_WASI_EPHEMERAL_NN != 0
809809WASM_RUNTIME_API_EXTERN void
810810wasm_runtime_instantiation_args_set_wasi_nn_graph_registry (
811- struct InstantiationArgs2 * p , struct wasi_nn_graph_registry * registry );
811+ struct InstantiationArgs2 * p , WASINNArguments * registry );
812812
813813WASM_RUNTIME_API_EXTERN bool
814- wasi_nn_graph_registry_set_args (struct wasi_nn_graph_registry * registry ,
815- const char * encoding , const char * target ,
816- uint32_t n_graphs , const char * * graph_paths );
814+ wasi_nn_graph_registry_set_args (WASINNArguments * registry , const char * encoding ,
815+ const char * target , uint32_t n_graphs ,
816+ const char * * graph_paths );
817817#endif
818818
819819/* See wasm_export.h for description */
@@ -1468,7 +1468,7 @@ wasm_runtime_check_and_update_last_used_shared_heap(
14681468 uint8 * * shared_heap_base_addr_adj_p , bool is_memory64 );
14691469#endif
14701470
1471- #if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
1471+ #if WASM_ENABLE_WASI_NN != 0 || WASM_ENABLE_WASI_EPHEMERAL_NN != 0
14721472WASM_RUNTIME_API_EXTERN bool
14731473wasm_runtime_init_wasi_nn_global_ctx (WASMModuleInstanceCommon * module_inst ,
14741474 const char * encoding , const char * target ,
0 commit comments