Skip to content

Commit 458c4ea

Browse files
Fixed compiler warnings from code in assertions, comparison of signed and unsigned types
1 parent 86090ff commit 458c4ea

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

dpctl/tensor/libtensor/source/tensor_py.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@ void simplify_iteration_space(int &nd,
411411
}
412412
}
413413

414-
assert(simplified_shape.size() == nd);
415-
assert(simplified_src_strides.size() == nd);
416-
assert(simplified_dst_strides.size() == nd);
414+
assert(simplified_shape.size() == static_cast<size_t>(nd));
415+
assert(simplified_src_strides.size() == static_cast<size_t>(nd));
416+
assert(simplified_dst_strides.size() == static_cast<size_t>(nd));
417417
int contracted_nd = simplify_iteration_two_strides(
418418
nd, simplified_shape.data(), simplified_src_strides.data(),
419419
simplified_dst_strides.data(),
@@ -472,9 +472,9 @@ void simplify_iteration_space(int &nd,
472472
simplified_dst_strides.push_back(dst_strides[0]);
473473
}
474474

475-
assert(simplified_shape.size() == nd);
476-
assert(simplified_src_strides.size() == nd);
477-
assert(simplified_dst_strides.size() == nd);
475+
assert(simplified_shape.size() == static_cast<size_t>(nd));
476+
assert(simplified_src_strides.size() == static_cast<size_t>(nd));
477+
assert(simplified_dst_strides.size() == static_cast<size_t>(nd));
478478
}
479479
}
480480

@@ -1329,9 +1329,9 @@ void copy_numpy_ndarray_into_usm_ndarray(
13291329
simplified_shape, simplified_src_strides,
13301330
simplified_dst_strides, src_offset, dst_offset);
13311331

1332-
assert(simplified_shape.size() == nd);
1333-
assert(simplified_src_strides.size() == nd);
1334-
assert(simplified_dst_strides.size() == nd);
1332+
assert(simplified_shape.size() == static_cast<size_t>(nd));
1333+
assert(simplified_src_strides.size() == static_cast<size_t>(nd));
1334+
assert(simplified_dst_strides.size() == static_cast<size_t>(nd));
13351335

13361336
// handle nd == 0
13371337
if (nd == 0) {

0 commit comments

Comments
 (0)