Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephan Seitz
pystencils
Commits
354877bb
Commit
354877bb
authored
Dec 16, 2019
by
Martin Geitner
Browse files
add index Field parameter to ast
parent
c7a4918a
Pipeline
#20544
failed with stage
in 2 minutes and 17 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pystencils/kernelcreation.py
View file @
354877bb
...
...
@@ -76,6 +76,9 @@ def create_kernel(assignments,
[0., 4., 4., 4., 0.],
[0., 0., 0., 0., 0.]])
"""
#save the original assignments
assign
=
assignments
# ---- Normalizing parameters
split_groups
=
()
if
isinstance
(
assignments
,
AssignmentCollection
):
...
...
@@ -130,7 +133,8 @@ def create_kernel(assignments,
if
use_auto_for_assignments
:
for
a
in
ast
.
atoms
(
SympyAssignment
):
a
.
use_auto
=
True
ast
.
assignments
=
assignments
ast
.
assignments
=
assign
ast
.
indexFields
=
False
return
ast
...
...
@@ -181,6 +185,9 @@ def create_indexed_kernel(assignments,
[0. , 0. , 0. , 4.3, 0. ],
[0. , 0. , 0. , 0. , 0. ]])
"""
assign
=
assignments
indF
=
index_fields
if
isinstance
(
assignments
,
Assignment
):
assignments
=
[
assignments
]
elif
isinstance
(
assignments
,
AssignmentCollection
):
...
...
@@ -213,7 +220,8 @@ def create_indexed_kernel(assignments,
else
:
raise
ValueError
(
"Unknown target %s. Has to be either 'cpu' or 'gpu'"
%
(
target
,))
ast
.
assignments
=
assignments
ast
.
assignments
=
assign
ast
.
indexFields
=
indF
return
ast
...
...
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