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
Jonas Plewinski
pystencils
Commits
1b7ae9aa
Commit
1b7ae9aa
authored
Mar 05, 2019
by
Martin Bauer
Browse files
Removed dead code
parent
40ed13f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
kernelcreation.py
View file @
1b7ae9aa
from
types
import
MappingProxyType
import
sympy
as
sp
from
pystencils.field
import
Field
from
pystencils.assignment
import
Assignment
from
pystencils.astnodes
import
LoopOverCoordinate
,
Conditional
,
Block
,
SympyAssignment
from
pystencils.cpu.vectorization
import
vectorize
...
...
@@ -159,22 +158,6 @@ def create_indexed_kernel(assignments, index_fields, target='cpu', data_type="do
raise
ValueError
(
"Unknown target %s. Has to be either 'cpu' or 'gpu'"
%
(
target
,))
def
create_staggered_kernel_from_assignments
(
assignments
,
**
kwargs
):
assert
'iteration_slice'
not
in
kwargs
and
'ghost_layers'
not
in
kwargs
lhs_fields
=
{
a
.
lhs
.
atoms
(
Field
.
Access
)
for
a
in
assignments
}
assert
len
(
lhs_fields
)
==
1
staggered_field
=
lhs_fields
.
pop
()
dim
=
staggered_field
.
spatial_dimensions
counters
=
[
LoopOverCoordinate
.
get_loop_counter_symbol
(
i
)
for
i
in
range
(
dim
)]
conditions
=
[
counters
[
i
]
<
staggered_field
.
shape
[
i
]
-
1
for
i
in
range
(
dim
)]
guarded_assignments
=
[]
for
d
in
range
(
dim
):
cond
=
sp
.
And
(
*
[
conditions
[
i
]
for
i
in
range
(
dim
)
if
d
!=
i
])
guarded_assignments
.
append
(
Conditional
(
cond
,
Block
(
assignments
)))
def
create_staggered_kernel
(
staggered_field
,
expressions
,
subexpressions
=
(),
target
=
'cpu'
,
**
kwargs
):
"""Kernel that updates a staggered field.
...
...
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