Skip to content

Commit

Permalink
resolve comments (part2)
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-eire committed Oct 26, 2024
1 parent 824c75f commit 93be3f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions onnxruntime/core/providers/webgpu/buffer_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,8 @@ class BucketCacheManager : public IBufferCacheManager {
std::sort(buckets_keys_.begin(), buckets_keys_.end());

#ifndef NDEBUG // if debug build
for (size_t i = 0; i < buckets_keys_.size(); ++i) {
ORT_ENFORCE(buckets_keys_[i] % 16 == 0, "Bucket sizes must be multiples of 16.");
}
ORT_ENFORCE(std::all_of(buckets_keys_.begin(), buckets_keys_.end(), [](size_t size) { return size % 16 == 0; }),
"Bucket sizes must be multiples of 16.");

for (size_t i = 1; i < buckets_keys_.size(); ++i) {
ORT_ENFORCE(buckets_keys_[i] > buckets_keys_[i - 1], "Bucket sizes must be in increasing order.");
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/webgpu/tensor/gather.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Status GatherProgram::GenerateShaderCode(ShaderHelper& shader) const {
<< " }\n"
<< " var data_indices : data_indices_t;\n";
for (int i = 0, j = 0; i < data.Rank(); i++) {
if (i == SafeInt<int>(axis_)) {
if (static_cast<uint32_t>(i) == axis_) {
shader.MainFunctionBody() << " " << data.IndicesSet("data_indices", i, "u32(idx)") << ";\n";
j += indices.Rank();
} else {
Expand Down

0 comments on commit 93be3f4

Please sign in to comment.