diff --git a/onnxruntime/core/providers/webgpu/math/binary_elementwise_ops.cc b/onnxruntime/core/providers/webgpu/math/binary_elementwise_ops.cc index 8feb5daae3f5..bae7c6a73c4c 100644 --- a/onnxruntime/core/providers/webgpu/math/binary_elementwise_ops.cc +++ b/onnxruntime/core/providers/webgpu/math/binary_elementwise_ops.cc @@ -142,7 +142,7 @@ Status BinaryElementwise::ComputeInternal(ComputeContext& context) const { } } - SafeInt vec_size = (size + 3) / 4; + uint32_t vec_size = SafeInt((size + 3) / 4); BinaryElementwiseProgram program{kernel_name_, expression_, is_broadcast, diff --git a/onnxruntime/core/providers/webgpu/tensor/transpose.cc b/onnxruntime/core/providers/webgpu/tensor/transpose.cc index b620e83843b2..0962d9191d78 100644 --- a/onnxruntime/core/providers/webgpu/tensor/transpose.cc +++ b/onnxruntime/core/providers/webgpu/tensor/transpose.cc @@ -52,7 +52,7 @@ const std::string AppendPermFunction(gsl::span perm) { ss.imbue(std::locale::classic()); ss << "fn perm(i: y_indices_t)->x_indices_t {\n" " var a: x_indices_t;\n"; - for (auto i = 0; i < perm.size(); ++i) { + for (size_t i = 0; i < perm.size(); ++i) { ss << " a[" << perm[i] << "] = i[" << i << "];\n"; } ss << " return a;\n"