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
Markus Holzer
pystencils
Commits
7595c329
Commit
7595c329
authored
Nov 21, 2021
by
Michael Kuron
Browse files
create_staggered_kernel: ignore inapplicable CreateKernelConfig defaults
parent
9bad685f
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/kernelcreation.py
View file @
7595c329
...
...
@@ -333,7 +333,15 @@ def create_staggered_kernel(assignments, target: Target = Target.CPU, gpu_exclus
Returns:
AST, see `create_kernel`
"""
assert
'iteration_slice'
not
in
kwargs
and
'ghost_layers'
not
in
kwargs
and
'omp_single_loop'
not
in
kwargs
if
'ghost_layers'
in
kwargs
:
assert
kwargs
[
'ghost_layers'
]
is
None
del
kwargs
[
'ghost_layers'
]
if
'iteration_slice'
in
kwargs
:
assert
kwargs
[
'iteration_slice'
]
is
None
del
kwargs
[
'iteration_slice'
]
if
'omp_single_loop'
in
kwargs
:
assert
kwargs
[
'omp_single_loop'
]
is
False
del
kwargs
[
'omp_single_loop'
]
if
isinstance
(
assignments
,
AssignmentCollection
):
subexpressions
=
assignments
.
subexpressions
+
[
a
for
a
in
assignments
.
main_assignments
...
...
@@ -437,6 +445,9 @@ def create_staggered_kernel(assignments, target: Target = Target.CPU, gpu_exclus
remove_start_conditional
=
any
([
gl
[
0
]
==
0
for
gl
in
ghost_layers
])
prepend_optimizations
=
[
lambda
ast
:
remove_conditionals_in_staggered_kernel
(
ast
,
remove_start_conditional
),
move_constants_before_loop
]
if
'cpu_prepend_optimizations'
in
kwargs
:
prepend_optimizations
+=
kwargs
[
'cpu_prepend_optimizations'
]
del
kwargs
[
'cpu_prepend_optimizations'
]
ast
=
create_kernel
(
final_assignments
,
ghost_layers
=
ghost_layers
,
target
=
target
,
omp_single_loop
=
False
,
cpu_prepend_optimizations
=
prepend_optimizations
,
**
kwargs
)
return
ast
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