Skip to content

Commit

Permalink
Use correct type, to avoid int narrowing (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
manopapad authored May 24, 2023
1 parent 6778b2a commit 1f96c2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cunumeric/index/advanced_indexing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ struct AdvancedIndexingImplBody<VariantKind::CPU, CODE, DIM, OUT_TYPE> {
const AccessorRO<bool, DIM>& index,
const Pitches<DIM - 1>& pitches,
const Rect<DIM>& rect,
const int volume,
const int key_dim,
const int skip_size) const
const size_t volume,
const size_t key_dim,
const size_t skip_size) const
{
size_t out_idx = 0;
for (size_t idx = 0; idx < volume; ++idx) {
Expand Down Expand Up @@ -65,7 +65,7 @@ struct AdvancedIndexingImplBody<VariantKind::CPU, CODE, DIM, OUT_TYPE> {
{
// skip_size is number of elements per each out[key_dim-1] sub-array
size_t skip_size = 1;
for (int i = key_dim; i < DIM; i++) {
for (size_t i = key_dim; i < DIM; i++) {
auto diff = 1 + rect.hi[i] - rect.lo[i];
if (diff != 0) skip_size *= diff;
}
Expand Down

0 comments on commit 1f96c2f

Please sign in to comment.