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

Installed QFunction Helpers #1037

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Installed QFunction Helpers #1037

wants to merge 1 commit into from

Conversation

jeremylt
Copy link
Member

@jeremylt jeremylt commented Aug 5, 2022

We can start adding helper functions we want to install on this branch.

We should make sure any helper function we add is used somewhere.

I think we need to find a balance between having a large number of files and a large number of unused function warnings.

@jedbrown
Copy link
Member

jedbrown commented Aug 5, 2022

One design decision here is how strongly typed to make these interfaces. If you do something like the following, you can eliminate a class of mistakes by compile-time errors. The downside is that raw access to arrays is harder.

typedef struct {
    CeedScalar values[3][3];
} Mat3x3;

typedef struct {
    CeedScalar values[6];
} Mat3x3KelvinMandel;

In C++, you can make types like this that also overload the [] operator so you can have standard indexing and strong typing. There is lots of prior art in this space (header-only libraries for small matrix arithmetic) and I'd be reluctant to create something new without a compelling reason after evaluating the prior art.

@jrwrigh
Copy link
Collaborator

jrwrigh commented Jan 30, 2023

I've added quite a few Vector and matrix related tools in my SGS branch (this commit specifically: 1f559ec).

Most of the matrix ones are built with a size-agnostic function, with a wrapper to get the function signature in a more user-friendly format. I figure that the compiler should be able to do all the loop unrolling it wants, especially since the size of the loops are known at runtime. Would we be interested in taking a similar strategy here?

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

Successfully merging this pull request may close these issues.

None yet

4 participants