Skip to content

Commit 29bccad

Browse files
authored
[webgpu] fix compiling error (#23139)
### Description <!-- Describe your changes. --> ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. -->
1 parent 4aca8f3 commit 29bccad

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

onnxruntime/core/providers/webgpu/buffer_manager.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ void BufferManager::Download(WGPUBuffer src, void* dst, size_t size) {
321321

322322
// TODO: revise wait in whole project
323323

324-
ORT_ENFORCE(context_.Wait(staging_buffer.MapAsync(wgpu::MapMode::Read, 0, buffer_size, wgpu::CallbackMode::WaitAnyOnly, [](wgpu::MapAsyncStatus status, const char* message) {
325-
ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", message);
324+
ORT_ENFORCE(context_.Wait(staging_buffer.MapAsync(wgpu::MapMode::Read, 0, buffer_size, wgpu::CallbackMode::WaitAnyOnly, [](wgpu::MapAsyncStatus status, wgpu::StringView message) {
325+
ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", std::string_view{message});
326326
})) == Status::OK());
327327

328328
auto mapped_data = staging_buffer.GetConstMappedRange();

onnxruntime/core/providers/webgpu/webgpu_context.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,8 @@ void WebGpuContext::CollectProfilingData(profiling::Events& events) {
532532
0,
533533
query_read_buffer.GetSize(),
534534
wgpu::CallbackMode::WaitAnyOnly,
535-
[](wgpu::MapAsyncStatus status, const char* message) {
536-
ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", message);
535+
[](wgpu::MapAsyncStatus status, wgpu::StringView message) {
536+
ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", std::string_view{message});
537537
})) == Status::OK());
538538
auto mapped_data = static_cast<const uint64_t*>(query_read_buffer.GetConstMappedRange());
539539

0 commit comments

Comments
 (0)