Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion onnxruntime/contrib_ops/webgpu/bert/flash_attention.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
}
program.AddOutputs({{present_key, ProgramTensorMetadataDependency::Rank, components},
{present_value, ProgramTensorMetadataDependency::Rank, components}})
.AddIndices(valid_present_shape);
.AddIndices(std::move(valid_present_shape));

Check warning on line 100 in onnxruntime/contrib_ops/webgpu/bert/flash_attention.cc

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <utility> for move [build/include_what_you_use] [4] Raw Output: onnxruntime/contrib_ops/webgpu/bert/flash_attention.cc:100: Add #include <utility> for move [build/include_what_you_use] [4]
program.SetDispatchGroupSize(onnxruntime::narrow<uint32_t>(valid_kv_size + 63 / 64))
.SetWorkgroupSize(64)
.CacheHint(has_past, parameters.qkv_format_, parameters.past_present_share_buffer_)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@
// Mode Vectorize broadcast
// cache hint: "V{a_rank};{b_rank};{output_rank}"
program
.AddIndices(reshaped_output_shape)
.AddIndices(reshaped_lhs_shape)
.AddIndices(reshaped_rhs_shape)
.AddIndices(std::move(reshaped_output_shape))
.AddIndices(std::move(reshaped_lhs_shape))
.AddIndices(std::move(reshaped_rhs_shape))

Check warning on line 195 in onnxruntime/core/providers/webgpu/math/binary_elementwise_ops.cc

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <utility> for move [build/include_what_you_use] [4] Raw Output: onnxruntime/core/providers/webgpu/math/binary_elementwise_ops.cc:195: Add #include <utility> for move [build/include_what_you_use] [4]
.CacheHint("V");
} else {
// Mode Broadcast
Expand Down
14 changes: 2 additions & 12 deletions onnxruntime/core/providers/webgpu/program.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
}

ProgramBase& ProgramBase::AddInput(ProgramInput&& input) {
inputs_.emplace_back(input);
inputs_.emplace_back(std::move(input));
return *this;
}

Expand All @@ -299,7 +299,7 @@
}

ProgramBase& ProgramBase::AddOutput(ProgramOutput&& output) {
outputs_.emplace_back(output);
outputs_.emplace_back(std::move(output));

Check warning on line 302 in onnxruntime/core/providers/webgpu/program.cc

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <utility> for move [build/include_what_you_use] [4] Raw Output: onnxruntime/core/providers/webgpu/program.cc:302: Add #include <utility> for move [build/include_what_you_use] [4]
return *this;
}

Expand All @@ -308,16 +308,6 @@
return *this;
}

ProgramBase& ProgramBase::AddIndices(const TensorShape& shape) {
indices_.emplace_back(shape);
return *this;
}

ProgramBase& ProgramBase::AddIndices(TensorShape&& shape) {
indices_.emplace_back(shape);
return *this;
}

ProgramBase& ProgramBase::SetDispatchGroupSize(uint32_t x) {
return SetDispatchGroupSize(x, 1, 1);
}
Expand Down
8 changes: 5 additions & 3 deletions onnxruntime/core/providers/webgpu/program.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,11 @@ class ProgramBase {
// add multiple program outputs
ProgramBase& AddOutputs(std::initializer_list<ProgramOutput> outputs);
// add a program variable for indices
ProgramBase& AddIndices(const TensorShape& shape);
// add a program variable for indices
ProgramBase& AddIndices(TensorShape&& shape);
template <typename... Args>
ProgramBase& AddIndices(Args&&... args) {
indices_.emplace_back(std::forward<Args>(args)...);
return *this;
}

// set the size of dispatch groups. Y and Z are 1 if not specified.
ProgramBase& SetDispatchGroupSize(uint32_t x);
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/webgpu/tensor/expand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
{data_size},
});
if (components_i != components_o) {
program.AddIndices(output_shape);
program.AddIndices(std::move(output_shape));

Check warning on line 56 in onnxruntime/core/providers/webgpu/tensor/expand.cc

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <utility> for move [build/include_what_you_use] [4] Raw Output: onnxruntime/core/providers/webgpu/tensor/expand.cc:56: Add #include <utility> for move [build/include_what_you_use] [4]
}
return context.RunProgram(program);
}
Expand Down
Loading