Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[linalg] specification glitches #7214

Open
mhoemmen opened this issue Aug 11, 2024 · 0 comments
Open

[linalg] specification glitches #7214

mhoemmen opened this issue Aug 11, 2024 · 0 comments

Comments

@mhoemmen
Copy link

[linalg] specification glitches

Many thanks to my NVIDIA colleague Ilya Burylov for discovering these issues.

We've checked this against the current C++ Working Draft N4988.

Fix [linalg.transp.layout.transpose]

For all mdspan layout mappings in the Standard, the layout itself (e.g., layout_right) has no members other than the class template mapping, and mapping has all the layout-related "stuff." However, this appears to be broken with layout_transpose. There, layout_transpose itself has private members nested-mapping_ and extents_. Additional evidence that this is incorrect is that layout_transpose::mapping constructor specification refers to initializing nested-mapping_ and extents_.

I am the main author of this proposal; I did not intend this. nested-mapping_ and extents_ should instead be private members of layout_transpose::mapping.

Fix [linalg.conj.conjugatedaccessor]

Fix constructor from NestedAccessor

The conjugated_accessor(const NestedAccessor& acc) constructor appears in the wording ([linalg.conj.conjugatedaccessor] para 3) but is missing from the class synopsis (para 1). Please add it to the class synopsis, immediately after conjugated_accessor's default constructor.

Fix converting constructor from conjugated_accessor<OtherNestedAccessor>

For the converting constructor from const conjugated_accessor<OtherNestedAcessor>&, in both the condition inside explicit in the class synopsis (para 1) and the condition inside explicit in the description (just above para 4) have an extra closing >.

Fix return type of nested_accessor member function

The nested_accessor member function of conjugated_accessor (which is defined inline in the class' synopsis) currently returns const Accessor&. This is incorrect, because there is no Accessor type in scope.

The intent is for the function to return const NestedAccessor&. As main author of this proposal, this is the intent. At some point in revisions, the template parameter was renamed from Accessor to NestedAccessor. It's likely that we missed changing the return type of nested_accessor.

Fix [linalg.scaled.scaledaccessor]

Exposition-only private members scaling-factor and nested-accessor of scaled_accessor lack the trailing underscore that private members of other class templates in [linalg] have. This is not incorrect, but it would be more consistent with the rest of [linalg] for these members to have a trailing underscore. The resulting change would need to be made throughout [linalg.scaled.scaledaccessor], not just in the class synopsis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant