ORNL / cpp-proposals-pub

Collaborating on papers for the ISO C++ committee - public repo
26 stars 27 forks source link

P0009 layout_stride constructor #53

Closed hcedwar closed 6 years ago

hcedwar commented 6 years ago

The layout_stride is_contiguous covers the conditions for contiguous property. These properties do not need to be enforced / duplicated in the constructor. A stride of zero should be allowed in the constructor.

crtrott commented 6 years ago

The constructor enforces is_unique not is_contiguous. is_contiguous is not always true.

crtrott commented 6 years ago

And stride of zero doesn't make any sense, other than for a degenerated mdspan of size()==0. If we allow that the whole definition construct false over.

crtrott commented 6 years ago

Also the blas use case for stride 0 kind of makes sense for the math operation, but I don't agree that layout_stride is the right thing to use for that. If you want that lets introduce a "layout_singleton" or so, which makes mapping(i...)==0 that feels like a much more elegant solution.

crtrott commented 6 years ago

In section 2.5.3. of the blast standard it says that stride must be larger than 0, btw.

crtrott commented 6 years ago

I believe this is resolved? We are requiring s[r]>0

crtrott commented 6 years ago

Closing for now if you think I shouldn't have please reopen.