Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pystencils_autodiff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
pycodegen
pystencils_autodiff
Commits
de5370a8
Commit
de5370a8
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Fix importing of _compile_env
parent
aad5610c
Branches
ci-experiments
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#17983
passed
5 years ago
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pystencils_autodiff/tensorflow_jit.py
+5
-5
5 additions, 5 deletions
src/pystencils_autodiff/tensorflow_jit.py
tests/test_native_tensorflow_compilation.py
+3
-4
3 additions, 4 deletions
tests/test_native_tensorflow_compilation.py
with
8 additions
and
9 deletions
src/pystencils_autodiff/tensorflow_jit.py
+
5
−
5
View file @
de5370a8
...
...
@@ -29,7 +29,7 @@ if get_compiler_config()['os'] != 'windows':
_include_flags
=
[
'
-I
'
+
sysconfig
.
get_paths
()[
'
include
'
],
'
-I
'
+
get_pystencils_include_path
()]
_do_not_link_flag
=
"
-c
"
_position_independent_flag
=
"
-fPIC
"
_compile_env
ironment
=
os
.
environ
.
copy
()
_compile_env
=
os
.
environ
.
copy
()
else
:
_do_not_link_flag
=
"
/c
"
_output_flag
=
'
/OUT:
'
...
...
@@ -38,8 +38,8 @@ else:
_position_independent_flag
=
"
/DTHIS_FLAG_DOES_NOTHING
"
get_compiler_config
()[
'
command
'
]
=
'
cl.exe
'
config_env
=
get_compiler_config
()[
'
env
'
]
if
'
env
'
in
get_compiler_config
()
else
{}
_compile_env
ironment
=
os
.
environ
.
copy
()
_compile_env
ironment
.
update
(
config_env
)
_compile_env
=
os
.
environ
.
copy
()
_compile_env
.
update
(
config_env
)
try
:
...
...
@@ -79,7 +79,7 @@ def link(object_files, destination_file=None, overwrite_destination_file=True, a
_output_flag
,
destination_file
]
# /out: for msvc???
subprocess
.
check_call
(
command
,
env
=
_compile_env
ironment
)
subprocess
.
check_call
(
command
,
env
=
_compile_env
)
return
destination_file
...
...
@@ -151,7 +151,7 @@ def compile_file(file, use_nvcc=False, nvcc='nvcc', overwrite_destination_file=T
destination_file
]
if
not
exists
(
destination_file
)
or
overwrite_destination_file
:
subprocess
.
check_call
(
command
,
env
=
_compile_env
ironment
)
subprocess
.
check_call
(
command
,
env
=
_compile_env
)
return
destination_file
...
...
This diff is collapsed.
Click to expand it.
tests/test_native_tensorflow_compilation.py
+
3
−
4
View file @
de5370a8
...
...
@@ -16,17 +16,16 @@ from sysconfig import get_paths
import
pytest
import
sympy
from
pystencils_autodiff
import
create_backward_assignments
from
pystencils_autodiff._file_io
import
write_file
from
pystencils_autodiff.backends.astnodes
import
TensorflowModule
import
pystencils
from
pystencils.cpu.cpujit
import
get_compiler_config
from
pystencils.include
import
get_pystencils_include_path
from
pystencils_autodiff
import
create_backward_assignments
from
pystencils_autodiff._file_io
import
write_file
from
pystencils_autodiff.backends.astnodes
import
TensorflowModule
from
pystencils_autodiff.tensorflow_jit
import
_compile_env
def
test_detect_cpu_vs_cpu
():
for
target
in
(
'
cpu
'
,
'
gpu
'
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment