Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
ef2152e
P3663: Add constant_wrapper implementation
mhoemmen May 6, 2025
00bf62f
P3663: Test that strided_slice works with std::cw
mhoemmen May 6, 2025
62d8bba
P3663: Stub submdspan_canonicalize_slices
mhoemmen May 7, 2025
d8332ac
Support Clang 21.0.0 -std=c++2c
mhoemmen May 20, 2025
c847a54
Implement check-static-bounds and others
mhoemmen May 20, 2025
0259594
Fix submdspan_canonicalize_slices for one slice
mhoemmen May 21, 2025
7092b24
Fix canonical_ice & 1 strided_slice
mhoemmen May 21, 2025
825e659
Put dims in the correct namespace
mhoemmen May 21, 2025
cc8b3ef
Add submdspan_canonicalize_slices rank 2 test
mhoemmen May 21, 2025
71b85ba
CHECKPOINT
mhoemmen May 22, 2025
b049333
IT BUILDS -- pulled in R0 impl
mhoemmen May 22, 2025
de58bc0
submdspan_mapping with canonical slices actually builds now
mhoemmen May 23, 2025
a336fb0
CHECKPOINT
mhoemmen May 23, 2025
4ab3ef6
P3663 & non-P3663 versions build & pass tests
mhoemmen May 23, 2025
c82425f
Deploy is_canonical_slice_type in layout_left
mhoemmen May 23, 2025
a87b24d
Add is_canonical_slice_type check to all submdspan_mapping_impl
mhoemmen May 23, 2025
25f725e
Check canonical k-th slice type
mhoemmen May 23, 2025
0e17f67
Replace integral_constant with cw
mhoemmen May 27, 2025
7ba02e6
Remove unneeded first_of and last_of overloads
mhoemmen May 27, 2025
8a5c18f
Remove index_pair_like definition
mhoemmen May 27, 2025
3a5bcc7
Replace is_range_slice with is_range_slice_v
mhoemmen May 27, 2025
c9aa31d
Simplify StaticExtentFromStridedRange
mhoemmen May 27, 2025
cc99e2c
Simplify extents_constructor for P3663
mhoemmen May 27, 2025
443d3fc
Remove superfluous TODO
mhoemmen May 27, 2025
57ae578
Reconcile implementation with draft P3663R2
mhoemmen May 27, 2025
26faa32
Add check_static_bounds test
mhoemmen Jun 3, 2025
b804fac
check_static_bounds: add convertible to full_extents_t test
mhoemmen Jun 3, 2025
96c4f49
check_static_bounds: Add strided_slice tests
mhoemmen Jun 3, 2025
f7b43a2
check_static_bounds: Make test more concise
mhoemmen Jun 3, 2025
d9bccc1
check_static_bounds: Improve 14.4 testing
mhoemmen Jun 4, 2025
4403b82
check_static_bounds: Improve 14.4 testing more
mhoemmen Jun 4, 2025
2e10f5c
Add 1st draft of submdspan benchmark
mhoemmen Jun 5, 2025
a09cdd3
Benchmark improvements
mhoemmen Jun 5, 2025
d77b1a7
Fix convertible-to-index-type bug
mhoemmen Jun 6, 2025
d8a4350
Fix P3663 benchmark and expand
mhoemmen Jun 6, 2025
a020448
Improve benchmark
mhoemmen Jun 23, 2025
b14253f
Refine submdspan benchmark
mhoemmen Jun 23, 2025
62c9158
Attempt to work around GCC 11.4.0 C++20 ICE
mhoemmen Jun 24, 2025
930998a
Get GCC 11.4.0 (C++20) to a meaningful build error
mhoemmen Jun 24, 2025
202af61
Fix GCC 11.4.0 C++20 build
mhoemmen Jun 24, 2025
aa69810
Simplify GCC 11.4.0 C++20 work-around
mhoemmen Jun 25, 2025
0c8baea
Clean up GCC 11.4.0 C++20 work-around
mhoemmen Jun 25, 2025
ea51c88
Fix Clang 14 C++20 build
mhoemmen Jun 25, 2025
dc90e90
Fix submdspan benchmark when P3663 is disabled
mhoemmen Jun 26, 2025
edc4387
Make MDSPAN_CONSTANT_WRAPPER_WORKAROUND a CMake option
mhoemmen Jun 26, 2025
50f372a
Fix GCC 15.1.0 build
mhoemmen Jun 26, 2025
d64407d
Merge branch 'stable' into P3663
mhoemmen Feb 6, 2026
20e4c6b
Fix build issue from merge
mhoemmen Feb 6, 2026
d7bf6c8
Remove extra semicolon
mhoemmen Feb 6, 2026
b8f9028
Fix some clang C++14 build errors
mhoemmen Feb 6, 2026
da5eb54
Remove C++20 requirement from benchmark
mhoemmen Feb 6, 2026
7fdd1d3
Fix (spurious) unused parameter warning
mhoemmen Feb 6, 2026
c191da1
Try setting MDSPAN_ENABLE_P3663=ON by default
mhoemmen Feb 6, 2026
61c84fd
Attempt to "back-port" constant_wrapper to C++17
mhoemmen Feb 6, 2026
86651ad
Backwards-compatible integral-constant-like
mhoemmen Feb 6, 2026
2bedcc3
Redefine mdspan_is_integral_constant correctly
mhoemmen Feb 6, 2026
684f978
Remove mdspan_is_integral_constant which is unused
mhoemmen Feb 6, 2026
a5f2a45
Convert StaticExtentFromRange
mhoemmen Feb 6, 2026
ef95a53
Get rid of __mdspan_integral_constant_like
mhoemmen Feb 6, 2026
00ce7f3
Introduce mdspan_constant_wrapper alias
mhoemmen Feb 6, 2026
b4494ea
Some simplifications
mhoemmen Feb 9, 2026
50c22e2
Attempt at constant_wrapper work-around
mhoemmen Feb 9, 2026
49cf216
Some more C++17 back-porting
mhoemmen Feb 9, 2026
f5fda95
Add is_layout_mapping_alike_v
mhoemmen Feb 9, 2026
efe3f07
Attempt to fix is_integral_constant_like_v
mhoemmen Feb 9, 2026
1d6cdb4
Make de_ice build with C++17
mhoemmen Feb 10, 2026
be1360b
Fix some tests
mhoemmen Feb 10, 2026
c1bd3ad
C++17 with P3663 ON now build and passes tests!
mhoemmen Feb 10, 2026
d6777fa
Remove C++20 lambda from submdspan definition
mhoemmen Feb 10, 2026
bc85778
Remove some C++20 designated initializers
mhoemmen Feb 10, 2026
90cd623
Remove unused parameter name
mhoemmen Feb 10, 2026
b2cd032
Fix more C++20 - isms
mhoemmen Feb 10, 2026
105c2f8
De-C++20-ize submdspan_canonicalize_slices
mhoemmen Feb 10, 2026
d635a05
Fix submdspan itself for C++17, locally
mhoemmen Feb 10, 2026
32d5788
Fix spurious unused parameter warning
mhoemmen Feb 10, 2026
a98fa87
Fix spurious unused parameter warning
mhoemmen Feb 10, 2026
f79a387
Remove more C++20 - isms
mhoemmen Feb 10, 2026
e8fda20
Get rid of more designated initializers
mhoemmen Feb 10, 2026
f9c3250
Remove unused type alias
mhoemmen Feb 10, 2026
6fa9d35
De-C++20-size test_canonicalize_slices
mhoemmen Feb 10, 2026
af6d1c8
Remove C++20-isms from test_submdspan_check_static_bounds
mhoemmen Feb 10, 2026
16a920f
Remove spurious semicolon
mhoemmen Feb 10, 2026
ab0e873
Remove more designated initializers
mhoemmen Feb 10, 2026
29a68be
Fix some unsigned/signed comparison warnings
mhoemmen Feb 10, 2026
0ef2b0a
Fix more things
mhoemmen Feb 10, 2026
7d4ad88
Fix more things
mhoemmen Feb 10, 2026
23f6403
Deduplicate last_of P3663 vs. not impls
mhoemmen Feb 10, 2026
9096894
Simplify constant_wrapper work-around
mhoemmen Feb 11, 2026
a54a075
Fix some (un)signed comparison warnings
mhoemmen Feb 11, 2026
69d73fb
Fix unused parameter warning
mhoemmen Feb 11, 2026
dc384a6
Work around icpx bug
mhoemmen Feb 11, 2026
ab198e4
Hide is_layout_mapping_alike from C++ < 17
mhoemmen Feb 11, 2026
0c90ab9
PREVIOUS COMMIT PASSES ALL CHECK-IN TESTS
mhoemmen Feb 11, 2026
59be174
DRIVE-BY FIX: Actually implement P2389
mhoemmen Feb 11, 2026
6fe00d7
Remove strided_slice deduction guide
mhoemmen Feb 13, 2026
524bdaf
Merge branch 'stable' into P3663
mhoemmen Feb 15, 2026
2bbe748
Fix dims merge
mhoemmen Feb 16, 2026
345dda4
Fix __mdspan_is_index_like_v
mhoemmen Feb 16, 2026
e0678c9
Remove C++26 branch from submdspan
mhoemmen Feb 16, 2026
f3da596
Simplify submdspan per review comment
mhoemmen Feb 16, 2026
087936f
Simplify first_of definition
mhoemmen Feb 16, 2026
efb4827
Simplify first_of more
mhoemmen Feb 16, 2026
e1505dd
Remove outdated comment
mhoemmen Feb 16, 2026
971c8fb
Fixes so that GCC trunk builds
mhoemmen Feb 16, 2026
426a5a3
Remove constant_wrapper back-port
mhoemmen Feb 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ option(MDSPAN_GENERATE_STD_NAMESPACE_TARGETS "Whether to generate and install ta

# Option to override which C++ standard to use
set(MDSPAN_CXX_STANDARD DETECT CACHE STRING "Override the default CXX_STANDARD to compile with.")
set_property(CACHE MDSPAN_CXX_STANDARD PROPERTY STRINGS DETECT 14 17 20 23)
set_property(CACHE MDSPAN_CXX_STANDARD PROPERTY STRINGS DETECT 14 17 20 23 26)

option(MDSPAN_ENABLE_CONCEPTS "Try to enable concepts support by giving extra flags." On)

option(MDSPAN_ENABLE_P3663 "Enable implementation of P3663 (Future-proof submdspan_mapping)." On)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually our only cmake-based feature switch? So this actually leads to the question of how we do this, because right now if someone is using mdspan via cmake this does nothing (as it only enables a compile definition for benchmarks).

So I suppose the question is do we want to add them to a target (e.g. via target_compile_definitions) or via a #cmakedefine sort of thing like Kokkos does where we generate a header with the define. We could even let it be overrideable via a define.

I actually am leaning towards the latter because we could use it in our single-header mode and the value could be overriden if using the header only mode via a define.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmm0 wrote:

... because right now if someone is using mdspan via cmake this does nothing....

Practically, it changes the implementation by changing the macro definitions in the headers -- at least it should! I might be missing something here.

Should we consider just removing this option and making the library implement P3663 unconditionally?


################################################################################

# Decide on the standard to use
Expand Down Expand Up @@ -63,8 +65,18 @@ elseif(MDSPAN_CXX_STANDARD STREQUAL "23")
else()
message(FATAL_ERROR "Requested MDSPAN_CXX_STANDARD \"23\" not supported by provided C++ compiler")
endif()
elseif(MDSPAN_CXX_STANDARD STREQUAL "26")
if("cxx_std_26" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
message(STATUS "Using C++26 standard")
set(CMAKE_CXX_STANDARD 26)
else()
message(WARNING "Requested MDSPAN_CXX_STANDARD \"26\" not supported by provided C++ compiler")
endif()
else()
if("cxx_std_23" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
if("cxx_std_26" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(CMAKE_CXX_STANDARD 26)
message(STATUS "Detected support for C++26 standard")
elseif("cxx_std_23" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(CMAKE_CXX_STANDARD 23)
message(STATUS "Detected support for C++23 standard")
elseif("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
Expand Down
10 changes: 10 additions & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ function(mdspan_add_benchmark EXENAME)
)
# Set flag to build with parenthesis enabled
target_compile_definitions(${EXENAME} PRIVATE MDSPAN_USE_PAREN_OPERATOR=1)
if(MDSPAN_ENABLE_P3663)
target_compile_definitions(${EXENAME} PUBLIC MDSPAN_ENABLE_P3663=1)
endif()
endfunction()

if(MDSPAN_USE_SYSTEM_BENCHMARK)
Expand Down Expand Up @@ -66,6 +69,9 @@ function(mdspan_add_cuda_benchmark EXENAME)
if(_benchmark_libs_old MATCHES "-pthread")
target_compile_options(${EXENAME} PUBLIC "-Xcompiler=-pthread")
endif()
if(MDSPAN_ENABLE_P3663)
target_compile_definitions(${EXENAME} PUBLIC MDSPAN_ENABLE_P3663=1)
endif()
endfunction()

if(MDSPAN_ENABLE_OPENMP)
Expand All @@ -81,6 +87,9 @@ function(mdspan_add_openmp_benchmark EXENAME)
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/benchmarks>
)
target_compile_definitions(${EXENAME} PRIVATE MDSPAN_USE_PAREN_OPERATOR=1)
if(MDSPAN_ENABLE_P3663)
target_compile_definitions(${EXENAME} PUBLIC MDSPAN_ENABLE_P3663=1)
endif()
else()
message(WARNING "Not adding target ${EXENAME} because OpenMP was not found")
endif()
Expand All @@ -92,3 +101,4 @@ add_subdirectory(matvec)
add_subdirectory(copy)
add_subdirectory(stencil)
add_subdirectory(tiny_matrix_add)
add_subdirectory(submdspan)
6 changes: 6 additions & 0 deletions benchmarks/submdspan/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

mdspan_add_benchmark(submdspan)

#if(MDSPAN_ENABLE_CUDA)
# add_subdirectory(cuda)
#endif()
Comment on lines +4 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if(MDSPAN_ENABLE_CUDA)
# add_subdirectory(cuda)
#endif()

9 changes: 9 additions & 0 deletions benchmarks/submdspan/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --extended-lambda")
endif()

mdspan_add_cuda_benchmark(submdspan_cuda)
target_include_directories(submdspan_cuda PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/benchmarks/submdspan>
)
Loading