ggml-webgpu: Update to a recent version of Dawn (llama/28683)

* ggml-webgpu: Update to a recent version of Dawn

* No module scanning

* Accept review suggestion to update comment

Co-authored-by: Masashi Yoshimura <yoshimura.masashi.frbs@gmail.com>

---------

Co-authored-by: Masashi Yoshimura <yoshimura.masashi.frbs@gmail.com>
This commit is contained in:
Mendy Berger
2026-09-14 20:45:06 +03:00
committed by Georgi Gerganov
co-authored by Masashi Yoshimura
parent 2c1b52573c
commit b17794130a
2 changed files with 17 additions and 10 deletions
+6
View File
@@ -39,6 +39,12 @@ ggml_add_backend_library(ggml-webgpu
add_dependencies(ggml-webgpu generate_shaders) add_dependencies(ggml-webgpu generate_shaders)
# Dawn needs C++20 (https://dawn.googlesource.com/dawn/+/refs/heads/main/docs/quickstart-cmake.md#prerequisites)
target_compile_features(ggml-webgpu PRIVATE cxx_std_20)
# Disable C++20 module scanning since emscan-deps fails to find webgpu_cpp.h
set_target_properties(ggml-webgpu PROPERTIES CXX_SCAN_FOR_MODULES OFF)
if(EMSCRIPTEN) if(EMSCRIPTEN)
set(EMDAWNWEBGPU_DIR "" CACHE PATH "Path to emdawnwebgpu_pkg") set(EMDAWNWEBGPU_DIR "" CACHE PATH "Path to emdawnwebgpu_pkg")
+11 -10
View File
@@ -4006,16 +4006,17 @@ static void ggml_backend_webgpu_request_adapter(wgpu::Instance & instance, wgpu:
options.nextInChain = &adapterTogglesDesc; options.nextInChain = &adapterTogglesDesc;
#endif #endif
instance.WaitAny(instance.RequestAdapter( instance.WaitAny(
&options, wgpu::CallbackMode::AllowSpontaneous, instance.RequestAdapter(
[&adapter](wgpu::RequestAdapterStatus status, wgpu::Adapter _adapter, const char * message) { &options, wgpu::CallbackMode::AllowSpontaneous,
if (status != wgpu::RequestAdapterStatus::Success) { [&adapter](wgpu::RequestAdapterStatus status, wgpu::Adapter _adapter, wgpu::StringView message) {
GGML_LOG_ERROR("ggml_webgpu: Failed to get an adapter: %s\n", message); if (status != wgpu::RequestAdapterStatus::Success) {
return; GGML_LOG_ERROR("ggml_webgpu: Failed to get an adapter: %s\n", std::string(message).c_str());
} return;
adapter = std::move(_adapter); }
}), adapter = std::move(_adapter);
UINT64_MAX); }),
UINT64_MAX);
} }
static void create_webgpu_device(ggml_backend_webgpu_reg_context * ctx) { static void create_webgpu_device(ggml_backend_webgpu_reg_context * ctx) {