github web-platform-tests/wpt merge_pr_47556

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
6 months ago

webnn: Add a BYOB version of readBuffer()

This change prototypes a version of readBuffer() which, after fetching
the contents of the MLBuffer, writes into a buffer provided by the
developer.

This approach does not violate JavaScript's "run to completion"
semantics because the write into the buffer is done by a task that runs
on the same thread as script execution. That is, script cannot observe a
state in which the buffer is partially written. (Unless it is a
SharedArrayBuffer being observed by another worker.)

Change-Id: Ie952f8c7d549373910f6e46d979cf1bb05c4bd34
Cq-Include-Trybots: luci.chromium.try:win11-blink-rel,mac14-blink-rel
Bug: 358151311
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5771399
Reviewed-by: ningxin hu ningxin.hu@intel.com
Reviewed-by: Kent Tamura tkent@chromium.org
Commit-Queue: Reilly Grant reillyg@chromium.org
Cr-Commit-Position: refs/heads/main@{#1339935}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.