-
-
Notifications
You must be signed in to change notification settings - Fork 44
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 void* to tabulate_tensor kernel #749
Conversation
ffcx/codegeneration/utils.py
Outdated
|
||
Returns: | ||
A Numba signature and a code generation function that returns a void pointer. | ||
""" # noqa: D205 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be enough to add a new line after Custom intrinsic to return an empty void* pointer.
to drop the noqa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Done.
def get_void_pointer(typingctx, arr): | ||
"""Custom intrinsic to get a void* pointer from a NumPy array. | ||
|
||
This function takes a NumPy array and returns a void pointer to the array's data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't know how numpy lays out its data in an ndarray - could we be a bit more precise here on what this void ptr points to?
arr: The NumPy array to get the void pointer from. | ||
|
||
Returns: | ||
A Numba signature and a code generation function that returns a void pointer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, more precision on array's data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have expanded on the comment and I have added a test.
This looks fine to me, modulo the two comments on the docstrings related to 'numpy's data'. |
Has been replaced by #753 |
Add void* user_data to tabulate_tensor kernel to allow for easier extensions of non-standard integration kernels such as runtime kernels. Depends on dolfinx PR FEniCS/dolfinx#3643 .