-
Notifications
You must be signed in to change notification settings - Fork 187
Expand precompilation #1015
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
Merged
Merged
Expand precompilation #1015
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
198c5c2
Create expanded precompilation
MilesCranmer 5f628db
Expand conversions for precompile
MilesCranmer 8fdc8c9
Precompile more types
MilesCranmer 1c8dca1
Add calls from running `runtests.jl`
MilesCranmer 1ce1ea3
Remove overly-specific precompile statements
MilesCranmer 08aeb43
`Core.TypeofVarargs` requires newer Julia
MilesCranmer dcf5988
Require Julia >= 1.4
MilesCranmer 08f3eb1
Remove Julia 1.0 test
MilesCranmer ad27e94
Merge branch 'master' into precompilation
MilesCranmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| # Here, we precompile functions that are passed to cfunction by __init__, | ||
| # for the reasons described in JuliaLang/julia#12256. | ||
|
|
||
| precompile(pyjlwrap_call, (PyPtr,PyPtr,PyPtr)) | ||
| precompile(pyjlwrap_dealloc, (PyPtr,)) | ||
| precompile(pyjlwrap_repr, (PyPtr,)) | ||
| precompile(pyjlwrap_hash, (PyPtr,)) | ||
| precompile(pyjlwrap_hash32, (PyPtr,)) | ||
|
|
||
|
|
||
| # The following calls were mostly generated by running PySR | ||
| # with `--trace-compile=stderr` (see https://github.com/MilesCranmer/PySR/pull/230) | ||
|
|
||
| # pyjlwrap_new | ||
| precompile(Tuple{typeof(pyjlwrap_new), Nothing}) | ||
| precompile(Tuple{typeof(pyjlwrap_new), Function}) | ||
| precompile(Tuple{typeof(pyjlwrap_new), Array{Float32, 2}}) | ||
| precompile(Tuple{typeof(pyjlwrap_new), Array{Float32, 1}}) | ||
|
|
||
| # _pyjlwrap_call | ||
| precompile(Tuple{typeof(_pyjlwrap_call), Type, Ptr{PyObject_struct}, Ptr{PyObject_struct}}) | ||
| precompile(Tuple{typeof(_pyjlwrap_call), Function, Ptr{PyObject_struct}, Ptr{PyObject_struct}}) | ||
|
|
||
| # Conversions: | ||
| precompile(Tuple{typeof(convert), Type{Tuple{}}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Tuple{String}}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Tuple{Integer, Integer}}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Tuple{Array{Float32, N} where N, Array{Float32, N} where N}}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, Type}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, String}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, Nothing}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, Function}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, Bool}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, Array{Function, 1}}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, Array{Float32, 2}}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, Array{Float32, 1}}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, Integer}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, Float32}) | ||
| precompile(Tuple{typeof(convert), Type{PyObject}, Float64}) | ||
| precompile(Tuple{typeof(convert), Type{Type}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{String}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Nothing}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Function}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Bool}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Array{Function, 1}}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Array{Float32, 2}}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Array{Float32, 1}}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Integer}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Float32}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Float64}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Array{T, N} where N where T}, PyObject}) | ||
| precompile(Tuple{typeof(convert), Type{Array{Float32, N} where N}, PyObject}) | ||
|
|
||
| # Ref conversions: | ||
| precompile(Tuple{typeof(convert), Type{Ref{PyMethodDef}}, Base.RefValue{PyMethodDef}}) | ||
| precompile(Tuple{typeof(unsafe_convert), Type{Ref{Ptr{PyObject_struct}}}, Base.RefValue{Ptr{PyObject_struct}}}) | ||
| precompile(Tuple{typeof(unsafe_convert), Type{Ptr{PyObject_struct}}, Ptr{Nothing}}) | ||
|
|
||
| # C Conversions: | ||
| precompile(Tuple{typeof(Base.cconvert), Type{Ptr{PyObject_struct}}, Ptr{Nothing}}) | ||
| precompile(Tuple{typeof(Base.cconvert), Type, Base.RefValue{PyMethodDef}}) | ||
|
|
||
| # Arrays: | ||
| precompile(Tuple{typeof(pyocopy), PyArray{Float32, 2}}) | ||
| precompile(Tuple{typeof(pyocopy), PyArray{Float32, 1}}) | ||
| precompile(Tuple{Type{PyArray{Float32, 2}}, PyObject, PyArray_Info{Float32, 2}}) | ||
| precompile(Tuple{Type{PyArray{Float32, 1}}, PyObject, PyArray_Info{Float32, 1}}) | ||
| precompile(Tuple{Type{PyArray_Info{Float32, 2}}, Bool, Tuple{Int64, Int64}, Tuple{Int64, Int64}, Ptr{Nothing}, Bool, PyBuffer}) | ||
| precompile(Tuple{Type{PyArray_Info{Float32, 1}}, Bool, Tuple{Int64}, Tuple{Int64}, Ptr{Nothing}, Bool, PyBuffer}) | ||
| precompile(Tuple{typeof(py2array), Type, Array{Any, 1}, PyObject, Int64, Int64}) | ||
|
|
||
| # Assorted: | ||
| precompile(Tuple{typeof(weakref_callback), Ptr{PyObject_struct}, Ptr{PyObject_struct}}) | ||
| precompile(Tuple{typeof(unsafe_load), Ptr{Ptr{PyObject_struct}}}) | ||
| precompile(Tuple{typeof(tuptype), DataType, Bool, Int64}) | ||
| precompile(Tuple{typeof(pyreturn), PyObject}) | ||
| precompile(Tuple{typeof(pyreturn), Module}) | ||
| precompile(Tuple{typeof(pyo2ptr), Type}) | ||
| precompile(Tuple{typeof(pyisinstance), PyObject, Ptr{PyObject_struct}}) | ||
| precompile(Tuple{typeof(pyfunctionret), Function, Type, Type}) | ||
| precompile(Tuple{typeof(pyerror), String, PyError}) | ||
| precompile(Tuple{typeof(pydecref), PyObject}) | ||
| precompile(Tuple{typeof(pydecref), PyBuffer}) | ||
| precompile(Tuple{typeof(pyany_toany), Type}) | ||
| precompile(Tuple{typeof(istuplen), Type, Bool, Int64}) | ||
| precompile(Tuple{typeof(getproperty), PyError, Symbol}) | ||
| precompile(Tuple{typeof(current_python)}) | ||
| precompile(Tuple{typeof(_set_finalized)}) | ||
| precompile(Tuple{typeof(Base._append!), Array{PyMemberDef, 1}, Base.HasLength, Tuple{PyMemberDef, PyMemberDef}}) | ||
| precompile(Tuple{Type{PyDict{Symbol, PyObject, true}}, PyObject}) | ||
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.
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'm not sure what this one does. Can that be done for all the array types, or does this precompile statement have no effect?