From d9cd27a0a74782ed306645bdd429e0215739a069 Mon Sep 17 00:00:00 2001 From: Yulong Wang <7679871+fs-eire@users.noreply.github.com> Date: Tue, 14 Jan 2025 08:12:55 -0800 Subject: [PATCH] [WebGPU EP] use LOGS_DEFAULT for device lost logging (#23353) ### Description use LOGS_DEFAULT for device lost logging. Now since the GPU device lifecycle is managed by WebGpuContext, it's now able to use ORT logging. --- onnxruntime/core/providers/webgpu/webgpu_context.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/webgpu/webgpu_context.cc b/onnxruntime/core/providers/webgpu/webgpu_context.cc index 7e7ff7dbde..46e2069a52 100644 --- a/onnxruntime/core/providers/webgpu/webgpu_context.cc +++ b/onnxruntime/core/providers/webgpu/webgpu_context.cc @@ -103,8 +103,7 @@ void WebGpuContext::Initialize(const WebGpuBufferCacheConfig& buffer_cache_confi }); // TODO: revise temporary device lost handling device_desc.SetDeviceLostCallback(wgpu::CallbackMode::AllowSpontaneous, [](const wgpu::Device& /*device*/, wgpu::DeviceLostReason reason, const char* message) { - // cannot use ORT logger because it may be already destroyed - std::cerr << "WebGPU device lost (" << int(reason) << "): " << message; + LOGS_DEFAULT(INFO) << "WebGPU device lost (" << int(reason) << "): " << message; }); ORT_ENFORCE(wgpu::WaitStatus::Success == instance_.WaitAny(adapter_.RequestDevice(