Skip to content

Commit a2b9e6a

Browse files
committed
Update unittests and npm test
unittest for relaxed SIMD needs node v21 or newer. Add wasm.relaxedSimd to test-runner-cli-args
1 parent f74c618 commit a2b9e6a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

cmake/onnxruntime_unittests.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,12 @@ function(AddTest)
229229
list(APPEND TEST_NODE_FLAGS "--experimental-wasm-simd")
230230
endif()
231231

232+
if (onnxruntime_ENABLE_WEBASSEMBLY_RELAXED_SIMD)
233+
message(WARNING "Use system `node` to test Wasm relaxed SIMD. Please make sure to install node v21 or newer.")
234+
set(NODE_EXECUTABLE node)
235+
set(TEST_NODE_FLAGS)
232236
# prefer Node from emsdk so the version is more deterministic
233-
if (DEFINED ENV{EMSDK_NODE})
237+
elseif (DEFINED ENV{EMSDK_NODE})
234238
set(NODE_EXECUTABLE $ENV{EMSDK_NODE})
235239
else()
236240
# warning as we don't know what node version is being used and whether things like the TEST_NODE_FLAGS

js/web/script/test-runner-cli-args.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,10 @@ function parseWasmFlags(args: minimist.ParsedArgs): Env.WebAssemblyFlags {
305305
if (typeof simd !== 'undefined' && typeof simd !== 'boolean') {
306306
throw new Error('Flag "wasm.simd"/"wasm-enable-simd" must be a boolean value');
307307
}
308+
const relaxedSimd = (wasm.relaxedSimd = parseBooleanArg(wasm.relaxedSimd));
309+
if (typeof relaxedSimd !== 'undefined' && typeof relaxedSimd !== 'boolean') {
310+
throw new Error('Flag "wasm.relaxedSimd" must be a boolean value');
311+
}
308312
const proxy = (wasm.proxy = parseBooleanArg(wasm.proxy ?? args['wasm-enable-proxy']));
309313
if (typeof proxy !== 'undefined' && typeof proxy !== 'boolean') {
310314
throw new Error('Flag "wasm.proxy"/"wasm-enable-proxy" must be a boolean value');

0 commit comments

Comments
 (0)