mirror of
https://github.com/intel/llvm.git
synced 2026-01-22 23:49:22 +08:00
[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 <dalg24@gmail.com> Reviewed By: ldionne, #libc Spies: libcxx-commits, H-G-Hristov, tschuett, philnik, arichardson, Mordante, crtrott Differential Revision: https://reviews.llvm.org/D148067
This commit is contained in:
committed by
Nikolas Klauser
parent
02a029f7fb
commit
fcaccf817d
@@ -1162,6 +1162,16 @@ module std [system] {
|
||||
export initializer_list
|
||||
export *
|
||||
}
|
||||
module mdspan {
|
||||
header "mdspan"
|
||||
export array
|
||||
export span
|
||||
export *
|
||||
|
||||
module __mdspan {
|
||||
module extents { private header "__mdspan/extents.h" }
|
||||
}
|
||||
}
|
||||
module memory {
|
||||
header "memory"
|
||||
export *
|
||||
|
||||
Reference in New Issue
Block a user