Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fluiddyn
transonic
Commits
e0f4917c4181
Commit
927a2ff6
authored
Aug 12, 2019
by
Pierre Augier
Browse files
transonic_cl.cythonize.py
parent
a50050df1913
Changes
3
Hide whitespace changes
Inline
Side-by-side
transonic/backends/backend.py
View file @
e0f4917c
...
...
@@ -110,8 +110,9 @@ class Backend:
code
=
file
.
read
()
analyse
=
analyse_aot
(
code
,
path_py
)
code_backend
,
code_ext
,
lines_pxd
=
self
.
make_backend_code
(
path_py
,
analyse
)
code_backend
,
code_ext
,
lines_pxd
=
self
.
make_backend_code
(
path_py
,
analyse
)
if
not
code_backend
:
return
...
...
@@ -172,7 +173,11 @@ class Backend:
)
code
=
[
"
\n
"
+
code_dependance
+
"
\n
"
]
lines_pxd
=
[
"import cython"
]
# , "import numpy as np", "cimport numpy as np"]
lines_pxd
=
[]
if
self
.
name
==
"cython"
:
lines_pxd
=
[
"import cython
\n\n
import numpy as np
\n
cimport numpy as np
\n\n
"
]
# Deal with functions
for
func_name
,
fdef
in
boosted_dicts
[
"functions"
].
items
():
...
...
transonic_cl/cythonize.py
0 → 100644
View file @
e0f4917c
import
sys
from
distutils.core
import
setup
from
Cython.Build
import
cythonize
import
numpy
as
np
path
=
sys
.
argv
.
pop
()
sys
.
argv
.
extend
((
"build_ext"
,
"--inplace"
))
setup
(
ext_modules
=
cythonize
(
path
),
include_dirs
=
[
np
.
get_include
()])
transonic_cl/run_backend.py
View file @
e0f4917c
...
...
@@ -107,7 +107,7 @@ def main():
if
backend
==
"pythran"
:
args
.
insert
(
0
,
"pythran"
)
elif
backend
==
"cython"
:
args
=
[
"cythonize"
,
"-
i
"
,
"
-3
"
,
name
]
args
=
[
sys
.
executable
,
"-
m
"
,
"
transonic_cl.cythonize
"
,
name
]
name_lock
.
touch
()
try
:
completed_process
=
subprocess
.
run
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment