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

Add a multidimensional wrapper around c-array #21

Merged
merged 14 commits into from
Nov 30, 2023
Merged

Conversation

rrsettgast
Copy link
Member

@rrsettgast rrsettgast commented Nov 18, 2023

This allows for better use of compile time known dimension c-arrays, and provides indexing accessors that take a parameter pack.

note...after a while I wondered why I didn't just replicate the interface of std::mdspan or rather std::mdarray coming in c++23, but you can't really anyways since they overload the operator[] to follow something like:

template< typename ... INDICES>
constexpr inline T& operator[]( INDICES ... indices)

which you can't do until c++23.

We can certainly replicate the dependence on std::extents, which is also c++23 but functionally simple if we don't try to do a bunch with dynamic_extents.

@rrsettgast rrsettgast self-assigned this Nov 18, 2023
src/common/types.hpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@wrtobin wrtobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only two small things we can remove, other than getting the cuda builds passing this looks solid.

@rrsettgast rrsettgast merged commit debacd6 into main Nov 30, 2023
17 checks passed
@rrsettgast rrsettgast deleted the feature/addCArray branch December 7, 2023 17:54
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

Successfully merging this pull request may close these issues.

2 participants