Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Shape derivative #653
Shape derivative #653
Changes from 7 commits
7801aba
e1c75ae
d5f7ef7
5b65777
7f082e4
fae5379
1834af6
a2459dd
0172f8e
56bea13
1ae1762
518cfad
d21be90
e6e8885
dcb91ff
3e65f7e
ff71270
018e18d
99bd36e
6682724
a318539
426c3bd
d228d73
1f083df
6a8c137
140413d
1941946
4186210
67608be
4ae4dea
ce66f50
dcf4648
9111354
dca3992
e62a3f2
038fc46
6abba75
34f7937
7b7e168
5e37245
fe01bb6
3910286
56dd373
eb39b81
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can you check if
z
is inferible? E.g. with@code_warntype
?I would say that this brakes type-stability of this function, unless the compiler is smart enough to take advantage of the
if
statement.We want to preserve type-stability here. This is a performance-critical point.
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 done
InteractiveUtils.@code_warntype Gridap.Polynomials._gradient_nd!(v,xi,orders,terms,c,g,Float64)
and there is no red so I think it is fine. Is that the right way to go about it ?
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.
Thanks for running the test. Which were the types of the parameters in the call you tried? I mean the types of
v,xi,orders,terms,c,g
.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 used the types of the parameters that were used when that function was called in the MWE here. Namely:
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.
ok, good call. Thus, in your example call
isbitstype(T)
is going to be true, right? asT=Float64
, andisbitstype(Float64)
is true. Have you tried what happens with type stability ifisbitstype(T)
is false? On the other hand, why do you need this if else construct? (for my understanding).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.
BTW, I forgot to mention that the VSCode extension for Julia has also some support for integrated profiling https://discourse.julialang.org/t/julia-vs-code-extension-version-v0-17-released/42865
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.
the difference is i made an error trying to cook the function (did not import all the functions required in my scope). With amendment, there is now no red even when cooking it.
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.
ok, perfect. We are on the safe side here, then. (except for the dynamic memory allocation issue)
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 made an attempt at this in the most recent commit. Is this the right idea ?
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.
Yes, it is the right idea. Well done. There are still some comments to be addressed. I have put these along with the corresponding LOC.