wasi-nn: make the host use the wasi_ephemeral_nn version of tensor_data (#4411)

the motivations:

* make the actual input size available to the backends.
  (currently the backends have to make a guess from shape/type.)

* make the host logic look a bit similar to wasi_ephemeral_nn.

this is a backend api/abi change.
This commit is contained in:
YAMAMOTO Takashi
2025-06-27 08:41:42 +09:00
committed by GitHub
parent 23799a2cb6
commit 2372a472aa
9 changed files with 43 additions and 37 deletions

View File

@ -99,7 +99,7 @@ typedef enum {
// 4-byte f32 elements would have a data array of length 16). Naturally, this
// representation requires some knowledge of how to lay out data in
// memory--e.g., using row-major ordering--and could perhaps be improved.
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0 && defined(__wasm__)
#if !defined(__wasm__) || WASM_ENABLE_WASI_EPHEMERAL_NN != 0
typedef struct {
uint8_t *buf;
uint32_t size;