Closed a-sully closed 1 day ago
Yes, it should support SharedArrayBuffer
.
The current restriction prevents a multi-threaded build of Wasm framework, e.g. ONNXRuntime Web, from passing memory views (emscripten::typed_memory_view) to MLGraphBuilder.constant()
, that is unfortunate.
Currently,
constant()
takes anArrayBufferView
(https://www.w3.org/TR/webnn/#ref-for-dom-mlgraphbuilder-constant)AllowSharedBufferSource
is specified here as the following:Since this buffer data is always immediately copied (https://www.w3.org/TR/webnn/#dom-mlgraphbuilder-constant) I see no reason why we shouldn't allow passing an
ArrayBuffer
,SharedArrayBuffer
or sharedArrayBufferView
to this method, as well.