Skip to content

Commit

Permalink
merge main & include 1 more test
Browse files Browse the repository at this point in the history
  • Loading branch information
prathikr committed Dec 16, 2024
1 parent bf852c4 commit 20fb3e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 5 additions & 1 deletion onnxruntime/core/providers/webgpu/tensor/slice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ Status Slice::ComputeInternal(ComputeContext& context) const {
// temporary steps vector to handle negative steps
std::vector<int32_t> steps_tmp;
for (unsigned int i = 0; i < steps_raw.size(); i++) {
steps_tmp.push_back(static_cast<int32_t>(steps_raw[i]));
if (steps_raw[i] >= std::numeric_limits<int32_t>::max()) {

Check warning on line 160 in onnxruntime/core/providers/webgpu/tensor/slice.cc

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <limits> for numeric_limits<> [build/include_what_you_use] [4] Raw Output: onnxruntime/core/providers/webgpu/tensor/slice.cc:160: Add #include <limits> for numeric_limits<> [build/include_what_you_use] [4]
steps_tmp.push_back(std::numeric_limits<int32_t>::max());
} else {
steps_tmp.push_back(static_cast<int32_t>(steps_raw[i]));
}
}

if (static_cast<int64_t>(axes.size()) != input_rank) {
Expand Down
3 changes: 0 additions & 3 deletions onnxruntime/test/providers/cpu/tensor/slice_op.test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,6 @@ TEST(SliceTest, Slice5D_SubsetOfAxes_Flatten2Dims_OffsetInput) {
// ORT crash due to integer overflow on 32bit system
// See, https://github.com/microsoft/onnxruntime/issues/9368
TEST(SliceTest, Slice5D_LargeStep) {
if (DefaultWebGpuExecutionProvider().get() != nullptr) {
GTEST_SKIP() << "Not covered by WebGPU test suite";
}
RunSliceTest<float>({1, 2, 2, 2, 2},
{1.f, 2.f, 3.f, 4.f,
5.f, 6.f, 7.f, 8.f,
Expand Down

0 comments on commit 20fb3e1

Please sign in to comment.