Skip to content

Commit 71c07f3

Browse files
authored
deprecate legacy WAMR-specific "wasi_nn" module (#4382)
wasi_nn.h: deprecate legacy "wasi_nn" cf. #4326
1 parent e5091e4 commit 71c07f3

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#else
2222
#define WASI_NN_IMPORT(name) \
2323
__attribute__((import_module("wasi_nn"), import_name(name)))
24+
#warning You are using "wasi_nn", which is a legacy WAMR-specific ABI. It's deperecated and will likely be removed in future versions of WAMR. Please use "wasi_ephemeral_nn" instead. (For a WASM module, use the wasi_ephemeral_nn.h header instead. For the runtime configurations, enable WASM_ENABLE_WASI_EPHEMERAL_NN/WAMR_BUILD_WASI_EPHEMERAL_NN.)
2425
#endif
2526

2627
/**

core/iwasm/libraries/wasi-nn/src/wasi_nn.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
#include "wasi_nn_types.h"
2121
#include "wasm_export.h"
2222

23+
#if WASM_ENABLE_WASI_EPHEMERAL_NN == 0
24+
#warning You are using "wasi_nn", which is a legacy WAMR-specific ABI. It's deperecated and will likely be removed in future versions of WAMR. Please use "wasi_ephemeral_nn" instead. (For a WASM module, use the wasi_ephemeral_nn.h header instead. For the runtime configurations, enable WASM_ENABLE_WASI_EPHEMERAL_NN/WAMR_BUILD_WASI_EPHEMERAL_NN.)
25+
#endif
26+
2327
#define HASHMAP_INITIAL_SIZE 20
2428
#if defined(__APPLE__)
2529
#define LIB_EXTENTION ".dylib"

doc/build_wamr.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ cmake -DWAMR_BUILD_PLATFORM=linux -DWAMR_BUILD_TARGET=ARM
102102
103103
### **Enable lib wasi-nn**
104104
- **WAMR_BUILD_WASI_NN**=1/0, default to disable if not set
105+
> Note: WAMR_BUILD_WASI_NN without WAMR_BUILD_WASI_EPHEMERAL_NN is deprecated and will likely be removed in future versions of WAMR. Please consider to enable WAMR_BUILD_WASI_EPHEMERAL_NN as well.
105106
> Note: See [WASI-NN](../core/iwasm/libraries/wasi-nn) for more details.
106107
107108
### **Enable lib wasi-nn GPU mode**
@@ -360,4 +361,4 @@ For Valgrind, begin with the following configurations and add additional ones as
360361
-DWAMR_DISABLE_HW_BOUND_CHECK=0 \
361362
-DWAMR_DISABLE_WRITE_GS_BASE=0
362363
#...
363-
```
364+
```

0 commit comments

Comments
 (0)