Skip to content
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

Type instabilities #61

Merged
merged 7 commits into from
Nov 18, 2019
Merged

Type instabilities #61

merged 7 commits into from
Nov 18, 2019

Conversation

antoine-levitt
Copy link
Member

Work towards #60. Should take care of most of the implicit Float64 conversions.

(based on #59)

@antoine-levitt
Copy link
Member Author

It's actually quite pleasing how few of these we need. The bzmesh is in rational and the G are ints, so we have things like recip_lattice * (G+k) do the right thing all by itself

src/core/PspHgh.jl Outdated Show resolved Hide resolved
src/core/PspHgh.jl Outdated Show resolved Hide resolved
@mfherbst
Copy link
Member

I agree ... if what you committed so far is all that's needed ... that would be pretty good!

@antoine-levitt
Copy link
Member Author

So lda_c_vwn.jl would be pretty annoying to convert to generic. I think the only automatic option is to use ChangePrecision inside a generated function.

@antoine-levitt
Copy link
Member Author

I think apart from xc_fallback/ and occupation.jl we're fine.

@antoine-levitt
Copy link
Member Author

Something like this appears to work:

using ChangePrecision
@generated function f(x::T) where T
    @changeprecision T begin
        :(2/3*x)
    end
end

@mfherbst mfherbst force-pushed the type_instabilities branch 2 times, most recently from 618a016 to 348b832 Compare November 18, 2019 11:51
@mfherbst mfherbst mentioned this pull request Nov 18, 2019
@mfherbst mfherbst merged commit 8b519ac into master Nov 18, 2019
@mfherbst mfherbst deleted the type_instabilities branch November 18, 2019 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants