Skip to content

Commit

Permalink
Use std::string
Browse files Browse the repository at this point in the history
  • Loading branch information
xhcao committed Dec 20, 2024
1 parent bdca706 commit b392e92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/webgpu/buffer_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ 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, wgpu::StringView message) {
ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", message.data);
ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", std::string_view{message});
})) == Status::OK());

auto mapped_data = staging_buffer.GetConstMappedRange();
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/webgpu/webgpu_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ void WebGpuContext::CollectProfilingData(profiling::Events& events) {
query_read_buffer.GetSize(),
wgpu::CallbackMode::WaitAnyOnly,
[](wgpu::MapAsyncStatus status, wgpu::StringView message) {
ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", message.data);
ORT_ENFORCE(status == wgpu::MapAsyncStatus::Success, "Failed to download data from buffer: ", std::string_view{message});
})) == Status::OK());
auto mapped_data = static_cast<const uint64_t*>(query_read_buffer.GetConstMappedRange());

Expand Down

0 comments on commit b392e92

Please sign in to comment.