Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tom Harke
pystencils
Commits
b98decd5
Commit
b98decd5
authored
Nov 14, 2018
by
Martin Bauer
Browse files
PEP8 compliance
parent
dbf35da5
Changes
9
Hide whitespace changes
Inline
Side-by-side
astnodes.py
View file @
b98decd5
...
...
@@ -198,7 +198,7 @@ class KernelFunction(Node):
This function is expensive, cache the result where possible!
"""
field_map
=
{
f
.
name
:
f
for
f
in
self
.
fields_accessed
}
field_map
=
{
symbol_name_to_variable_name
(
f
.
name
)
:
f
for
f
in
self
.
fields_accessed
}
def
get_fields
(
symbol
):
if
hasattr
(
symbol
,
'field_name'
):
...
...
boundaries/boundaryhandling.py
View file @
b98decd5
...
...
@@ -223,7 +223,7 @@ class BoundaryHandling:
arguments
[
'indexField'
]
=
idx_arr
data_used_in_kernel
=
(
p
.
fields
[
0
].
name
for
p
in
self
.
_boundary_object_to_boundary_info
[
b_obj
].
kernel
.
parameters
if
isinstance
(
p
.
symbol
,
FieldPointerSymbol
)
and
p
.
field
s
[
0
].
name
not
in
arguments
)
if
isinstance
(
p
.
symbol
,
FieldPointerSymbol
)
and
p
.
field
_
name
not
in
arguments
)
arguments
.
update
({
name
:
b
[
name
]
for
name
in
data_used_in_kernel
if
name
not
in
arguments
})
kernel
=
self
.
_boundary_object_to_boundary_info
[
b_obj
].
kernel
...
...
cpu/cpujit.py
View file @
b98decd5
...
...
@@ -56,7 +56,6 @@ import subprocess
from
appdirs
import
user_config_dir
,
user_cache_dir
from
collections
import
OrderedDict
from
pystencils.kernelparameters
import
FieldPointerSymbol
,
FieldStrideSymbol
,
FieldShapeSymbol
from
pystencils.utils
import
recursive_dict_update
from
sysconfig
import
get_paths
from
pystencils
import
FieldType
...
...
cpu/kernelcreation.py
View file @
b98decd5
...
...
@@ -3,7 +3,7 @@ from functools import partial
from
pystencils.astnodes
import
SympyAssignment
,
Block
,
LoopOverCoordinate
,
KernelFunction
from
pystencils.transformations
import
resolve_buffer_accesses
,
resolve_field_accesses
,
make_loop_over_domain
,
\
add_types
,
get_optimal_loop_ordering
,
parse_base_pointer_info
,
move_constants_before_loop
,
\
split_inner_loop
,
substitute_array_accesses_with_constants
,
get_base_buffer_index
split_inner_loop
,
get_base_buffer_index
from
pystencils.data_types
import
TypedSymbol
,
BasicType
,
StructType
,
create_type
from
pystencils.field
import
Field
,
FieldType
import
pystencils.astnodes
as
ast
...
...
field.py
View file @
b98decd5
...
...
@@ -5,7 +5,7 @@ import numpy as np
import
sympy
as
sp
from
sympy.core.cache
import
cacheit
from
pystencils.alignedarray
import
aligned_empty
from
pystencils.data_types
import
create_type
,
create_composite_type_from_string
,
StructType
from
pystencils.data_types
import
create_type
,
StructType
from
pystencils.kernelparameters
import
FieldShapeSymbol
,
FieldStrideSymbol
from
pystencils.stencils
import
offset_to_direction_string
,
direction_string_to_offset
from
pystencils.sympyextensions
import
is_integer_sequence
...
...
gpucuda/cudajit.py
View file @
b98decd5
import
numpy
as
np
from
pystencils.backends.cbackend
import
generate_c
from
pystencils.kernelparameters
import
FieldPointerSymbol
,
FieldStrideSymbol
,
FieldShapeSymbol
from
pystencils.kernelparameters
import
FieldPointerSymbol
from
pystencils.sympyextensions
import
symbol_name_to_variable_name
from
pystencils.data_types
import
StructType
,
get_base_type
from
pystencils.data_types
import
StructType
from
pystencils.field
import
FieldType
...
...
gpucuda/kernelcreation.py
View file @
b98decd5
...
...
@@ -2,8 +2,7 @@ from functools import partial
from
pystencils.gpucuda.indexing
import
BlockIndexing
from
pystencils.transformations
import
resolve_field_accesses
,
add_types
,
parse_base_pointer_info
,
\
get_common_shape
,
substitute_array_accesses_with_constants
,
resolve_buffer_accesses
,
unify_shape_symbols
,
\
get_base_buffer_index
get_common_shape
,
resolve_buffer_accesses
,
unify_shape_symbols
,
get_base_buffer_index
from
pystencils.astnodes
import
Block
,
KernelFunction
,
SympyAssignment
,
LoopOverCoordinate
from
pystencils.data_types
import
TypedSymbol
,
BasicType
,
StructType
from
pystencils
import
Field
,
FieldType
...
...
llvm/llvmjit.py
View file @
b98decd5
...
...
@@ -3,7 +3,7 @@ import llvmlite.binding as llvm
import
numpy
as
np
import
ctypes
as
ct
from
pystencils.data_types
import
create_composite_type_from_string
from
..data_types
import
to_ctypes
,
ctypes_from_llvm
,
StructType
,
get_base_type
from
..data_types
import
to_ctypes
,
ctypes_from_llvm
,
StructType
from
.llvm
import
generate_llvm
from
pystencils.sympyextensions
import
symbol_name_to_variable_name
from
pystencils.field
import
FieldType
...
...
sympyextensions.py
View file @
b98decd5
...
...
@@ -553,4 +553,4 @@ class SymbolCreator:
def
symbol_name_to_variable_name
(
symbol_name
):
"""Replaces characters which are allowed in sympy symbol names but not in C/C++ variable names"""
return
symbol_name
.
replace
(
"^"
,
"_"
)
\ No newline at end of file
return
symbol_name
.
replace
(
"^"
,
"_"
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment