Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pystencils_walberla
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
Show more breadcrumbs
Stephan Seitz
pystencils_walberla
Commits
a5e5f2c3
Commit
a5e5f2c3
authored
6 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
walberla boundary class now also works for GPU boundaries
parent
c2a52c28
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jinja_filters.py
+10
-7
10 additions, 7 deletions
jinja_filters.py
with
10 additions
and
7 deletions
jinja_filters.py
+
10
−
7
View file @
a5e5f2c3
...
@@ -111,7 +111,7 @@ def field_extraction_code(field_accesses, field_name, is_temporary, declaration_
...
@@ -111,7 +111,7 @@ def field_extraction_code(field_accesses, field_name, is_temporary, declaration_
return
"
%s * %s;
"
%
(
field_type
,
field_name
)
return
"
%s * %s;
"
%
(
field_type
,
field_name
)
else
:
else
:
prefix
=
""
if
no_declaration
else
"
auto
"
prefix
=
""
if
no_declaration
else
"
auto
"
return
"
%s%s = block->
uncheckedFastG
etData< %s >(%sID);
"
%
(
prefix
,
field_name
,
field_type
,
field_name
)
return
"
%s%s = block->
g
etData< %s >(%sID);
"
%
(
prefix
,
field_name
,
field_type
,
field_name
)
else
:
else
:
assert
field_name
.
endswith
(
'
_tmp
'
)
assert
field_name
.
endswith
(
'
_tmp
'
)
original_field_name
=
field_name
[:
-
len
(
'
_tmp
'
)]
original_field_name
=
field_name
[:
-
len
(
'
_tmp
'
)]
...
@@ -170,7 +170,7 @@ def generate_refs_for_kernel_parameters(kernel_info, prefix, parameters_to_ignor
...
@@ -170,7 +170,7 @@ def generate_refs_for_kernel_parameters(kernel_info, prefix, parameters_to_ignor
@jinja2.contextfilter
@jinja2.contextfilter
def
generate_call
(
ctx
,
kernel_info
,
ghost_layers_to_include
=
0
,
cell_interval
=
None
,
stream
=
'
0
'
):
def
generate_call
(
ctx
,
kernel_info
,
ghost_layers_to_include
=
0
,
cell_interval
=
None
,
stream
=
'
0
'
,
spatial_shape_symbols
=
[]
):
"""
Generates the function call to a pystencils kernel
"""
Generates the function call to a pystencils kernel
Args:
Args:
...
@@ -290,11 +290,14 @@ def generate_call(ctx, kernel_info, ghost_layers_to_include=0, cell_interval=Non
...
@@ -290,11 +290,14 @@ def generate_call(ctx, kernel_info, ghost_layers_to_include=0, cell_interval=Non
kernel_call_lines
+=
create_field_shape_code
(
fields
[
param
.
field_name
],
param
.
name
)
kernel_call_lines
+=
create_field_shape_code
(
fields
[
param
.
field_name
],
param
.
name
)
if
not
is_cpu
:
if
not
is_cpu
:
spatial_shape_symbols
=
[]
if
not
spatial_shape_symbols
:
for
param
in
ast_params
:
spatial_shape_symbols
=
[]
if
param
.
is_field_shape_argument
:
for
param
in
ast_params
:
spatial_shape_symbols
=
[
TypedSymbol
(
"
%s_cpu[%d]
"
%
(
param
.
name
,
i
),
get_base_type
(
Field
.
SHAPE_DTYPE
))
if
param
.
is_field_shape_argument
:
for
i
in
range
(
field
.
spatial_dimensions
)]
spatial_shape_symbols
=
[
TypedSymbol
(
"
%s_cpu[%d]
"
%
(
param
.
name
,
i
),
get_base_type
(
Field
.
SHAPE_DTYPE
))
for
i
in
range
(
field
.
spatial_dimensions
)]
else
:
spatial_shape_symbols
=
[
TypedSymbol
(
e
,
get_base_type
(
Field
.
SHAPE_DTYPE
))
for
e
in
spatial_shape_symbols
]
if
not
spatial_shape_symbols
:
if
not
spatial_shape_symbols
:
for
param
in
ast_params
:
for
param
in
ast_params
:
...
...
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