From 7cba5e0a7a31109207f844e7b430a53d1008cea1 Mon Sep 17 00:00:00 2001 From: AI agent Date: Mon, 6 Apr 2026 10:53:49 +0000 Subject: [PATCH] Fix mem concepts non-copyable pitch test --- test/unit/mem/concepts.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/unit/mem/concepts.cpp b/test/unit/mem/concepts.cpp index c243df08c..d4e32f1f3 100644 --- a/test/unit/mem/concepts.cpp +++ b/test/unit/mem/concepts.cpp @@ -216,14 +216,16 @@ TEST_CASE( "test return value type of the access operator for alpaka::concepts::IDataSource and IMdSpan", "[mem][concept]") { - // the test is motivate by creating a MdSpan> + // This regression test models element types such as std::atomic: + // access must still work by reference even when the element type is not copyable. + // The pitch vector has to be computed from the same element type used by MdSpan. NonCopyStruct mcs; STATIC_REQUIRE_FALSE(std::convertible_to); STATIC_REQUIRE(std::convertible_to); concepts::Vector auto const extents = Vec{1u}; - concepts::Vector auto const pitches = alpaka::calculatePitchesFromExtents(extents); + concepts::Vector auto const pitches = alpaka::calculatePitchesFromExtents(extents); alpaka::MdSpan mdspan(&mcs, extents, pitches);