Skip to content

Commit fcaccf8

Browse files
crtrottphilnik777
authored andcommitted
[libcxx] Add mdspan/extents
This patch adds std::extents. extents is one of the core classes used by std::mdspan. It describes a multi-dimensional index space with a mix of compile time and runtime sizes. Furthermore, it is templated on the index type used to describe the multi-dimensional index space. The class is designed to be highly optimizable in performance critical code sections, and is fully useable in constant expressions contexts. Testing of this class tends to be somewhat combinatorical, due to the large number of possible corner cases involved in situations where we have both runtime and compile time extents. To add to this, the class is designed to be interoperable (in particular constructible) from arguments which only need to be convertible to the index_type, but are otherwise arbitrary user types. For a larger discussion on the design of this class refer to: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html Co-authored-by: Damien L-G <[email protected]> Reviewed By: ldionne, #libc Spies: libcxx-commits, H-G-Hristov, tschuett, philnik, arichardson, Mordante, crtrott Differential Revision: https://reviews.llvm.org/D148067
1 parent 02a029f commit fcaccf8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2218
-285
lines changed

libcxx/CREDITS.TXT

+9
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ E: [email protected]
9292
9393
D: Implemented floating-point to_chars.
9494

95+
N: Damien Lebrun-Grandie
96+
97+
98+
D: Implementation of mdspan.
99+
95100
N: Microsoft Corporation
96101
D: Contributed floating-point to_chars.
97102

@@ -149,6 +154,10 @@ N: Stephan Tolksdorf
149154
150155
D: Minor <atomic> fix
151156

157+
N: Christian Trott
158+
159+
D: Implementation of mdspan.
160+
152161
N: Ruben Van Boxem
153162
E: vanboxem dot ruben at gmail dot com
154163
D: Initial Windows patches.

libcxx/docs/FeatureTestMacroTable.rst

+2
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ Status
332332
------------------------------------------------- -----------------
333333
``__cpp_lib_is_scoped_enum`` ``202011L``
334334
------------------------------------------------- -----------------
335+
``__cpp_lib_mdspan`` *unimplemented*
336+
------------------------------------------------- -----------------
335337
``__cpp_lib_move_only_function`` *unimplemented*
336338
------------------------------------------------- -----------------
337339
``__cpp_lib_optional`` ``202110L``

libcxx/docs/Status/Cxx2bPapers.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"`P2442R1 <https://wg21.link/P2442R1>`__","LWG","Windowing range adaptors: ``views::chunk`` and ``views::slide``","February 2022","","","|ranges|"
5252
"`P2443R1 <https://wg21.link/P2443R1>`__","LWG","``views::chunk_by``","February 2022","","","|ranges|"
5353
"","","","","","",""
54-
"`P0009R18 <https://wg21.link/P0009R18>`__","LWG","mdspan: A Non-Owning Multidimensional Array Reference","July 2022","",""
54+
"`P0009R18 <https://wg21.link/P0009R18>`__","LWG","mdspan: A Non-Owning Multidimensional Array Reference","July 2022","|In progress|",""
5555
"`P0429R9 <https://wg21.link/P0429R9>`__","LWG","A Standard ``flat_map``","July 2022","",""
5656
"`P1169R4 <https://wg21.link/P1169R4>`__","LWG","``static operator()``","July 2022","|Complete|","16.0"
5757
"`P1222R4 <https://wg21.link/P1222R4>`__","LWG","A Standard ``flat_set``","July 2022","",""

libcxx/include/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ set(files
463463
__locale_dir/locale_base_api/bsd_locale_fallbacks.h
464464
__locale_dir/locale_base_api/locale_guard.h
465465
__mbstate_t.h
466+
__mdspan/extents.h
466467
__memory/addressof.h
467468
__memory/align.h
468469
__memory/aligned_alloc.h
@@ -913,6 +914,7 @@ set(files
913914
locale.h
914915
map
915916
math.h
917+
mdspan
916918
memory
917919
memory_resource
918920
mutex

0 commit comments

Comments
 (0)