Skip to content

Commit 3011c75

Browse files
committed
modifications in response to PR comments
1 parent 50d0869 commit 3011c75

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/ekat/kokkos/ekat_subview_utils.hpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ subview_1(const ViewLR<ST***,Props...>& v,
244244
// Since we are keeping the first dimension, the stride is unchanged.
245245
auto vm = tmp.impl_map();
246246
vm.m_impl_offset.m_stride = v.impl_map().stride_0();
247-
auto test = Unmanaged<ViewLR<ST**,Props...>>(v.impl_track(),vm);
248247
return Unmanaged<ViewLR<ST**,Props...>>(
249248
v.impl_track(),vm);
250249
}
@@ -318,7 +317,7 @@ subview_1(const ViewLR<ST******,Props...>& v,
318317
// ================ Multi-sliced Subviews ======================= //
319318
// e.g., instead of a single-entry slice like v(:, 42, :), we slice over a range
320319
// of values, as in v(:, 27:42, :)
321-
// this means that the subview has the same rank as the "parent" view
320+
// this means that the subview has the same rank as the source view
322321

323322
// --- Rank1 multi-slice --- //
324323
template <typename ST, typename... Props>
@@ -332,7 +331,7 @@ subview(const ViewLR<ST*, Props...>& v,
332331
// NOTE: the final comparison is originally int <= long unsigned int
333332
// the cast silences a warning, but may be unnecessary
334333
assert(kp0.first >= 0 && kp0.first < kp0.second
335-
&& (unsigned int)kp0.second <= v.extent(idim));
334+
&& kp0.second <= v.extent_int(idim));
336335
return Unmanaged<ViewLS<ST*,Props...>>(Kokkos::subview(v, kp0));
337336

338337
}
@@ -349,7 +348,7 @@ subview(const ViewLR<ST**, Props...>& v,
349348
// NOTE: the final comparison is originally int <= long unsigned int
350349
// the cast silences a warning, but may be unnecessary
351350
assert(kp0.first >= 0 && kp0.first < kp0.second
352-
&& (unsigned int)kp0.second <= v.extent(idim));
351+
&& kp0.second <= v.extent_int(idim));
353352
if (idim == 0) {
354353
return Unmanaged<ViewLS<ST**,Props...>>(Kokkos::subview(v, kp0, Kokkos::ALL));
355354
} else {
@@ -370,7 +369,7 @@ subview(const ViewLR<ST***, Props...>& v,
370369
// NOTE: the final comparison is originally int <= long unsigned int
371370
// the cast silences a warning, but may be unnecessary
372371
assert(kp0.first >= 0 && kp0.first < kp0.second
373-
&& (unsigned int)kp0.second <= v.extent(idim));
372+
&& kp0.second <= v.extent_int(idim));
374373
if (idim == 0) {
375374
return Unmanaged<ViewLS<ST***,Props...>>(
376375
Kokkos::subview(v, kp0, Kokkos::ALL, Kokkos::ALL));
@@ -396,7 +395,7 @@ subview(const ViewLR<ST****, Props...>& v,
396395
// NOTE: the final comparison is originally int <= long unsigned int
397396
// the cast silences a warning, but may be unnecessary
398397
assert(kp0.first >= 0 && kp0.first < kp0.second
399-
&& (unsigned int)kp0.second <= v.extent(idim));
398+
&& kp0.second <= v.extent_int(idim));
400399
if (idim == 0) {
401400
return Unmanaged<ViewLS<ST****,Props...>>(
402401
Kokkos::subview(v, kp0, Kokkos::ALL, Kokkos::ALL, Kokkos::ALL));
@@ -425,7 +424,7 @@ subview(const ViewLR<ST*****, Props...>& v,
425424
// NOTE: the final comparison is originally int <= long unsigned int
426425
// the cast silences a warning, but may be unnecessary
427426
assert(kp0.first >= 0 && kp0.first < kp0.second
428-
&& (unsigned int)kp0.second <= v.extent(idim));
427+
&& kp0.second <= v.extent_int(idim));
429428
if (idim == 0) {
430429
return Unmanaged<ViewLS<ST*****,Props...>>(
431430
Kokkos::subview(v, kp0, Kokkos::ALL, Kokkos::ALL, Kokkos::ALL, Kokkos::ALL));
@@ -457,7 +456,7 @@ subview(const ViewLR<ST******, Props...>& v,
457456
// NOTE: the final comparison is originally int <= long unsigned int
458457
// the cast silences a warning, but may be unnecessary
459458
assert(kp0.first >= 0 && kp0.first < kp0.second
460-
&& (unsigned int)kp0.second <= v.extent(idim));
459+
&& kp0.second <= v.extent_int(idim));
461460
if (idim == 0) {
462461
return Unmanaged<ViewLS<ST******,Props...>>(
463462
Kokkos::subview(v, kp0, Kokkos::ALL, Kokkos::ALL, Kokkos::ALL,

0 commit comments

Comments
 (0)