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
FunctionOperator caches prototypes of the input and output #145
Comments
The methods you highlighted are for Lines 290 to 300 in d2afff8
|
When we have out-of-place methods, we simply use them: Lines 287 to 288 in d2afff8
And for nonallocating |
I understand how these cached arrays are used, but I fail to see why they are needed? Would it not be more efficient to just store the size and element-type of Does that make sense? To make things clearer: why not store an allocator, rather than a prototype? |
|
I see. Thanks for this clarification. I understand I did not read correctly your first answer. |
No, even if you have both in-place Usually, the size of cache arrays ( I understand that you are working on a very large problem (10^9 points) and efficiency does matter. For now, if you want, we can set up a PR to skip caching when Eventually, we should support a truly fused 5-argument |
The in-place ones still should not pre-allocate and alias the output like that, that's dangerous. |
For the time being, I would not do anything to I do think that Thanks for your these clarifications! |
@ChrisRackauckas what's the dangerous aliasing part? |
The following will calculate the wrong result: y1 = A * x1
y2 = A * x2
y1 + y2 The reason is because |
@ChrisRackauckas it would be good to allow a syntax like |
The future is now. |
FunctionOperator
structures have acache = (in, out)
member, wherein
andout
are prototypes of the input and output.These prototypes are used in
*
and\
https://github.com/SciML/SciMLOperators.jl/blob/master/src/func.jl#L297-L307
This seems to me unnecessarily costly. Am I missing something?
The text was updated successfully, but these errors were encountered: