File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed
onnxruntime/core/providers/webgpu Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -644,10 +644,8 @@ if (onnxruntime_USE_WEBGPU)
644644
645645 # file "${DAWN_EMSCRIPTEN_TOOLCHAIN}/tools/maint/gen_struct_info.py" is missing from emsdk installation.
646646 # we should copy if from ${PROJECT_SOURCE_DIR}/patches/
647- file (COPY_FILE
648- "${PROJECT_SOURCE_DIR} /patches/emscripten/tools/maint/gen_struct_info.py"
649- "${DAWN_EMSCRIPTEN_TOOLCHAIN} /tools/maint/gen_struct_info.py"
650- ONLY_IF_DIFFERENT)
647+ file (COPY "${PROJECT_SOURCE_DIR} /patches/emscripten/tools/maint/gen_struct_info.py"
648+ DESTINATION "${DAWN_EMSCRIPTEN_TOOLCHAIN} /tools/maint/" )
651649 else ()
652650 if (onnxruntime_BUILD_DAWN_MONOLITHIC_LIBRARY)
653651 set (DAWN_BUILD_MONOLITHIC_LIBRARY ON CACHE BOOL "" FORCE)
Original file line number Diff line number Diff line change 3232 endif ()
3333
3434 target_link_libraries (onnxruntime_providers_webgpu PUBLIC emdawnwebgpu_cpp)
35+ target_link_options (onnxruntime_providers_webgpu PUBLIC "SHELL:-s ASYNCIFY=1" )
3536 else ()
3637 onnxruntime_add_include_to_target(onnxruntime_providers_webgpu dawn::dawncpp_headers dawn::dawn_headers)
3738
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ set BUILD_DIR=%ROOT%build_webgpu
1717:arg1
1818if [" %~1 " ]== [" d" ] (
1919 set CONFIG = Debug
20- set CONFIG_EXTRA_FLAG = --enable_wasm_profiling --cmake_extra_defines onnxruntime_ENABLE_WEBASSEMBLY_OUTPUT_OPTIMIZED_MODEL=1
20+ set CONFIG_EXTRA_FLAG = --enable_wasm_profiling --wasm_run_tests_in_browser
21+ @ rem --cmake_extra_defines onnxruntime_ENABLE_WEBASSEMBLY_OUTPUT_OPTIMIZED_MODEL=1
2122 @ rem --enable_wasm_debug_info
2223 goto :arg2
2324)
Original file line number Diff line number Diff line change @@ -696,9 +696,13 @@ WebGpuContext& WebGpuContextFactory::CreateContext(const WebGpuContextConfig& co
696696#endif
697697
698698 // Step.2 - Create wgpu::Instance
699+ #if !defined(__wasm__)
699700 wgpu::InstanceDescriptor instance_desc{};
700701 instance_desc.features .timedWaitAnyEnable = true ;
701702 default_instance_ = wgpu::CreateInstance (&instance_desc);
703+ #else
704+ default_instance_ = wgpu::CreateInstance (nullptr );
705+ #endif
702706
703707 ORT_ENFORCE (default_instance_ != nullptr , " Failed to create wgpu::Instance." );
704708 });
You can’t perform that action at this time.
0 commit comments