Skip to content

Commit

Permalink
[webgpu] fix compiling error
Browse files Browse the repository at this point in the history
  • Loading branch information
xhcao committed Dec 18, 2024
1 parent e76bd2f commit 6281d83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions onnxruntime/core/providers/webgpu/buffer_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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: ", message.data);
})) == Status::OK());

auto mapped_data = staging_buffer.GetConstMappedRange();
Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/core/providers/webgpu/webgpu_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,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: ", message.data);
})) == Status::OK());
auto mapped_data = static_cast<const uint64_t*>(query_read_buffer.GetConstMappedRange());

Expand Down

0 comments on commit 6281d83

Please sign in to comment.