From 29bccad96dfd17174388abef9443086e84808e2d Mon Sep 17 00:00:00 2001 From: xhcao Date: Sat, 21 Dec 2024 01:05:23 +0800 Subject: [PATCH] [webgpu] fix compiling error (#23139) ### Description ### Motivation and Context --- onnxruntime/core/providers/webgpu/buffer_manager.cc | 4 ++-- onnxruntime/core/providers/webgpu/webgpu_context.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/onnxruntime/core/providers/webgpu/buffer_manager.cc b/onnxruntime/core/providers/webgpu/buffer_manager.cc index 45eb123943de9..233bb24083289 100644 --- a/onnxruntime/core/providers/webgpu/buffer_manager.cc +++ b/onnxruntime/core/providers/webgpu/buffer_manager.cc @@ -321,8 +321,8 @@ void BufferManager::Download(WGPUBuffer src, void* dst, size_t size) { // TODO: revise wait in whole project - ORT_ENFORCE(context_.Wait(staging_buffer.MapAsync(wgpu::MapMode::Read, 0, buffer_size, wgpu::CallbackMode::WaitAnyOnly, [](wgpu::MapAsyncStatus status, const char* message) { - ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", message); + ORT_ENFORCE(context_.Wait(staging_buffer.MapAsync(wgpu::MapMode::Read, 0, buffer_size, wgpu::CallbackMode::WaitAnyOnly, [](wgpu::MapAsyncStatus status, wgpu::StringView message) { + ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", std::string_view{message}); })) == Status::OK()); auto mapped_data = staging_buffer.GetConstMappedRange(); diff --git a/onnxruntime/core/providers/webgpu/webgpu_context.cc b/onnxruntime/core/providers/webgpu/webgpu_context.cc index fae329835067f..b2f7748a54743 100644 --- a/onnxruntime/core/providers/webgpu/webgpu_context.cc +++ b/onnxruntime/core/providers/webgpu/webgpu_context.cc @@ -532,8 +532,8 @@ void WebGpuContext::CollectProfilingData(profiling::Events& events) { 0, query_read_buffer.GetSize(), wgpu::CallbackMode::WaitAnyOnly, - [](wgpu::MapAsyncStatus status, const char* message) { - ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", message); + [](wgpu::MapAsyncStatus status, wgpu::StringView message) { + ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", std::string_view{message}); })) == Status::OK()); auto mapped_data = static_cast(query_read_buffer.GetConstMappedRange());