Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 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
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
19 changes: 17 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ option(MDSPAN_INSTALL_STDMODE_HEADERS "Whether to install headers to emulate sta

# 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)." Off)

# Defaults to ON, because this has only been tested with Clang 21 (development Clang).
option(MDSPAN_CONSTANT_WRAPPER_WORKAROUND "If MDSPAN_ENABLE_P3663 is enabled, work around some compilers' inability to build constant_wrapper." ON)

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

# Decide on the standard to use
Expand Down Expand Up @@ -62,8 +67,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
28 changes: 28 additions & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ 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()
if(MDSPAN_CONSTANT_WRAPPER_WORKAROUND)
target_compile_definitions(${EXENAME}
PUBLIC
MDSPAN_CONSTANT_WRAPPER_WORKAROUND=1
)
endif()
endfunction()

if(MDSPAN_USE_SYSTEM_BENCHMARK)
Expand Down Expand Up @@ -66,6 +75,15 @@ 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()
if(MDSPAN_CONSTANT_WRAPPER_WORKAROUND)
target_compile_definitions(${EXENAME}
PUBLIC
MDSPAN_CONSTANT_WRAPPER_WORKAROUND=1
)
endif()
endfunction()

if(MDSPAN_ENABLE_OPENMP)
Expand All @@ -81,6 +99,15 @@ 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()
if(MDSPAN_CONSTANT_WRAPPER_WORKAROUND)
target_compile_definitions(${EXENAME}
PUBLIC
MDSPAN_CONSTANT_WRAPPER_WORKAROUND=1
)
endif()
else()
message(WARNING "Not adding target ${EXENAME} because OpenMP was not found")
endif()
Expand All @@ -92,3 +119,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()
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