Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR refines iterator access in MdSpan and MdSpanArray classes. The const-qualified Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/unit/mem/mdIterator.cpp (1)
92-105: Add direct const-iterator checks forMdSpanandMdSpanArray.The new read-only assertions currently only prove the
Viewpath. Adding one constMdSpanand one constMdSpanArrayround-trip here would exercise the overloads changed ininclude/alpaka/mem/MdSpan.hppandinclude/alpaka/mem/MdSpanArray.hpp.➕ Suggested coverage
std::array<int, 6> storage{2, 4, 6, 8, 10, 12}; auto view = alpaka::makeView(api::host, storage.data(), alpaka::Vec{2u, 3u}); auto const constView = view.getConstView(); + auto span = alpaka::makeMdSpan(storage.data(), alpaka::Vec{2u, 3u}); + int arrayStorage[2][3]{{2, 4, 6}, {8, 10, 12}}; + alpaka::MdSpanArray<decltype(arrayStorage), uint32_t> arraySpan(arrayStorage); static_assert(!std::is_const_v<std::remove_reference_t<decltype(*view.begin())>>); static_assert(std::is_const_v<std::remove_reference_t<decltype(*constView.begin())>>); static_assert(std::is_const_v<std::remove_reference_t<decltype(*std::as_const(view).begin())>>); + static_assert(std::is_const_v<std::remove_reference_t<decltype(*std::as_const(span).begin())>>); + static_assert(std::is_const_v<std::remove_reference_t<decltype(*std::as_const(arraySpan).begin())>>); REQUIRE(collectValues(view) == std::vector<int>{2, 4, 6, 8, 10, 12}); REQUIRE(collectValues(constView) == collectValues(view)); + REQUIRE(collectValues(std::as_const(span)) == collectValues(view)); + REQUIRE(collectValues(std::as_const(arraySpan)) == collectValues(view));🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/unit/mem/mdIterator.cpp` around lines 92 - 105, Add tests that exercise the const-iterator overloads for MdSpan and MdSpanArray: create a mutable MdSpan and MdSpanArray from the same storage used for View, obtain their const variants (e.g., via getConstView-like API or by binding to const MdSpan/MdSpanArray), add static_asserts that *const* iterators yield const references (similar to the View checks) and REQUIRE that collectValues(constMdSpan) and collectValues(constMdSpanArray) equal the mutable collectValues results; target the types MdSpan and MdSpanArray and the helper collectValues to ensure the MdSpan.hpp and MdSpanArray.hpp const overloads are exercised.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@test/unit/mem/mdIterator.cpp`:
- Around line 92-105: Add tests that exercise the const-iterator overloads for
MdSpan and MdSpanArray: create a mutable MdSpan and MdSpanArray from the same
storage used for View, obtain their const variants (e.g., via getConstView-like
API or by binding to const MdSpan/MdSpanArray), add static_asserts that *const*
iterators yield const references (similar to the View checks) and REQUIRE that
collectValues(constMdSpan) and collectValues(constMdSpanArray) equal the mutable
collectValues results; target the types MdSpan and MdSpanArray and the helper
collectValues to ensure the MdSpan.hpp and MdSpanArray.hpp const overloads are
exercised.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 5e7c9b73-9f14-491e-a025-c3dec5d07b04
📒 Files selected for processing (5)
include/alpaka/mem/MdSpan.hppinclude/alpaka/mem/MdSpanArray.hpptest/unit/mem/concepts.cpptest/unit/mem/idxRange.cpptest/unit/mem/mdIterator.cpp
|
@coderabbitai review |
19a8ada to
1588388
Compare
✅ Actions performedReview triggered.
|
cf3aac2 to
67eba11
Compare
1588388 to
8995315
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Split from local commit
6110d5c.Base branch:
dev.Summary by CodeRabbit
Bug Fixes
Tests