-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
WIP: build_function rewrite #764
Conversation
The way I want to go about completing this is take test cases or code using build_function in the wild and get it to work by adding back features they need. |
@isaacsas let's revisit BCR with this! |
Co-authored-by: "Yingbo Ma" <[email protected]>
Co-authored-by: "Yingbo Ma" <[email protected]>
Co-authored-by: "Yingbo Ma" <[email protected]>
@shashi Thanks a lot for your work on this, which is relevant to some issues I had previously. Could I please ask for you to also consider the tests/fix I had in #681 (which I originally wrote to fix #678)? |
@dpad thanks, I will try to do the changes in your PR over here. For a while now we have been interning the function itself into the expressions we evaluate -- this eliminates the need to try and qualify functions since they are not "name"s anymore. But we do need to take care of which compile cache RGF uses. Thanks! |
@dpad I moved the code over from there, and also tried defining |
08614d0
to
41130c8
Compare
Hi @shashi , thanks for merging them in! I've had a brief look, I believe the issue is due to a change in RuntimeGeneratedFunctions, where it's now using |
Work around to specify cache module when building RuntimeGeneratedFunctions
For reference, once SciML/RuntimeGeneratedFunctions.jl#26 is merged in, we should be able to clean up the workaround from #769 to just: function _build_and_inject_function(mod::Module, ex)
...
# Ensure the function is cached and looked-up in the specified module.
RuntimeGeneratedFunction(mod, mod, ex)
end [edit: this will now work with [email protected]] |
Oh great! Thank you!! |
Can't really explain the CI fail. The branch passed for me locally. |
The RGF change was just tagged. |
Based on JuliaSymbolics/SymbolicUtils.jl#183 (docs: https://juliasymbolics.github.io/SymbolicUtils.jl/codegen/)
The build_function.jl in test/ passes for me locally, but I suppose I may have deleted one too many keyword argument (and hence little feature) that something in the ecosystem breaks.
cc @ChrisRackauckas @YingboMa comments and tests are welcome!
The first argument to build_function can be any of the Code types in the Symutils PR, hence allowing arbitrary julia code! The only special case we handle here is arrays -- it is handled rather weirdly for legacy (and probably performance) reasons -- it returns 2 exprs rather than one: out of place and in-place.... Maybe we should make the user invoke build_function twice to do that?