Skip to content

Commit

Permalink
resolve comments (part4)
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-eire committed Oct 26, 2024
1 parent 9886fb6 commit ed32824
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions onnxruntime/core/providers/webgpu/webgpu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ class WebGpuContext final {
wgpu::RequiredLimits GetRequiredLimits(const wgpu::Adapter& adapter) const;
void WriteTimestamp(uint32_t query_index);

TimestampQueryType query_type_;
wgpu::QuerySet query_set_;
wgpu::Buffer query_resolve_buffer_;

struct PendingKernelInfo {
PendingKernelInfo(std::string_view kernel_name,
std::string_view program_name,
Expand Down Expand Up @@ -151,13 +147,7 @@ class WebGpuContext final {
wgpu::Buffer query_buffer;
};

// info of kernels pending submission for a single batch
std::vector<PendingKernelInfo> pending_kernels_;
// info of queries pending appending to profiling events
std::vector<PendingQueryInfo> pending_queries_;

uint64_t gpu_timestamp_offset_ = 0;
bool is_profiling_ = false;
friend class WebGpuContextFactory;

std::once_flag init_flag_;

Expand All @@ -175,10 +165,22 @@ class WebGpuContext final {

std::unique_ptr<webgpu::BufferManager> buffer_mgr_;
std::unique_ptr<ProgramManager> program_mgr_;
friend class WebGpuContextFactory;

uint32_t num_pending_dispatches_ = 0;
const uint32_t max_num_pending_dispatches_ = 16;

// profiling
TimestampQueryType query_type_;
wgpu::QuerySet query_set_;
wgpu::Buffer query_resolve_buffer_;

// info of kernels pending submission for a single batch
std::vector<PendingKernelInfo> pending_kernels_;
// info of queries pending appending to profiling events
std::vector<PendingQueryInfo> pending_queries_;

uint64_t gpu_timestamp_offset_ = 0;
bool is_profiling_ = false;
};

} // namespace webgpu
Expand Down

0 comments on commit ed32824

Please sign in to comment.