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

Specify scalar type as numpy type or numpy type name #3829

Open
miklos1 opened this issue Nov 8, 2018 · 0 comments
Open

Specify scalar type as numpy type or numpy type name #3829

miklos1 opened this issue Nov 8, 2018 · 0 comments
Assignees

Comments

@miklos1
Copy link
Member

miklos1 commented Nov 8, 2018

It would be better to receive scalar type in the parameters dict not as a C99 typename string, but rather as a numpy type (np.float64) or numpy type name ('float64') -- they are easily convertible to one another, as well as to dtype instances. The latter helps deciding complex mode easier (dtype(name).kind == 'c') as well as looking up default precision.

This representation of scalar type could easily be mapped to a C type name through a predefined dict when it comes to code generation. Alternatively, one could map to C++ type names when needed, e.g.,
double complex is C99 and does not work in C++, which is problem when the generated code needs to be compiled as C++ because of Eigen, for example.

The numpy type representation is also required when interfacing loopy.

@sv2518 sv2518 self-assigned this Mar 25, 2020
@connorjward connorjward transferred this issue from firedrakeproject/tsfc Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants