-
Notifications
You must be signed in to change notification settings - Fork 62
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
Make extern
recursive?
#47
Comments
Some of the tests right now rely on |
I tried out option 1. Seems to inline just fine
|
Is inlining in anyway version dependent? E.g. does it ever work on Julia 1.3 but not 1.0? |
That above was on 1.1. I could check on the LTS Update: yes, it is also all good on the LTS |
Two additional thoughts: |
We should probably try and avoid creating those.
Yes I think We might want something else like |
it is not too hard to endup in a situtation where you have say
Thunk(()->Thunk(()->3))
ie.,@thunk(@thunk(3))
One example (written in #30 style) is if you have
Especially with #30 where we (by nescity) throw a lot more
@thunk
s around.This is particularly annoying in test right now, and so probably in real use too.
I see two ways to resolve this:
1. make
extern(::Thunk)
recursivethis is just changing
to
This doesn't help for
(Casted(Zero())
orCasted(@thunk(3))
etcbut Casted could have the same change I guess,
or it could just or away #10
2. make all externing recursive
We would change current definitions of
extern
intoextern1
then change
extern
to callextern1
until the result is no longer aAbstractDifferential
.(either via recursion, or via a loop)
3. Make `Thunk(()->Thunk
Way harder than it looks.
Similarly does not apply to things other than thunks
Not sure on the implications of these on inlining,
I know inlining hates recursion.
Here is some test code I prepared earlier.
I think the first one is a good place to start.
And will likely PR that and rebase it into #30
The text was updated successfully, but these errors were encountered: