Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
hyteg
pystencils
Commits
262446d1
Commit
262446d1
authored
2 years ago
by
Markus Holzer
Browse files
Options
Downloads
Plain Diff
Merge branch 'gpu_bufferfield_fix' into 'master'
Gpu bufferfield fix See merge request
pycodegen/pystencils!314
parents
e18aa374
9204c46b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/gpucuda/kernelcreation.py
+1
-1
1 addition, 1 deletion
pystencils/gpucuda/kernelcreation.py
pystencils/transformations.py
+12
-3
12 additions, 3 deletions
pystencils/transformations.py
with
13 additions
and
4 deletions
pystencils/gpucuda/kernelcreation.py
+
1
−
1
View file @
262446d1
...
...
@@ -34,7 +34,7 @@ def create_cuda_kernel(assignments: Union[AssignmentCollection, NodeCollection],
all_fields
=
fields_read
.
union
(
fields_written
)
read_only_fields
=
set
([
f
.
name
for
f
in
fields_read
-
fields_written
])
buffers
=
set
([
f
for
f
in
all_fields
if
FieldType
.
is_buffer
(
f
)
or
FieldType
.
is_custom
(
f
)
])
buffers
=
set
([
f
for
f
in
all_fields
if
FieldType
.
is_buffer
(
f
)])
fields_without_buffers
=
all_fields
-
buffers
field_accesses
=
set
()
...
...
This diff is collapsed.
Click to expand it.
pystencils/transformations.py
+
12
−
3
View file @
262446d1
...
...
@@ -161,9 +161,11 @@ def make_loop_over_domain(body, iteration_slice=None, ghost_layers=None, loop_or
tuple of loop-node, ghost_layer_info
"""
# find correct ordering by inspecting participating FieldAccesses
absolut_accesses_only
=
False
field_accesses
=
body
.
atoms
(
Field
.
Access
)
field_accesses
=
{
e
for
e
in
field_accesses
if
not
e
.
is_absolute_access
}
if
len
(
field_accesses
)
==
0
:
# when kernel contains only absolute accesses
absolut_accesses_only
=
True
# exclude accesses to buffers from field_list, because buffers are treated separately
field_list
=
[
e
.
field
for
e
in
field_accesses
if
not
(
FieldType
.
is_buffer
(
e
.
field
)
or
FieldType
.
is_custom
(
e
.
field
))]
if
len
(
field_list
)
==
0
:
# when kernel contains only custom fields
...
...
@@ -174,14 +176,21 @@ def make_loop_over_domain(body, iteration_slice=None, ghost_layers=None, loop_or
if
loop_order
is
None
:
loop_order
=
get_optimal_loop_ordering
(
fields
)
shape
=
get_common_shape
(
fields
)
if
absolut_accesses_only
:
absolut_access_fields
=
{
e
.
field
for
e
in
body
.
atoms
(
Field
.
Access
)}
shape
=
get_common_shape
(
absolut_access_fields
)
else
:
shape
=
get_common_shape
(
fields
)
unify_shape_symbols
(
body
,
common_shape
=
shape
,
fields
=
fields
)
if
iteration_slice
is
not
None
:
iteration_slice
=
normalize_slice
(
iteration_slice
,
shape
)
if
ghost_layers
is
None
:
required_ghost_layers
=
max
([
fa
.
required_ghost_layers
for
fa
in
field_accesses
])
if
absolut_accesses_only
:
required_ghost_layers
=
0
else
:
required_ghost_layers
=
max
([
fa
.
required_ghost_layers
for
fa
in
field_accesses
])
ghost_layers
=
[(
required_ghost_layers
,
required_ghost_layers
)]
*
len
(
loop_order
)
if
isinstance
(
ghost_layers
,
int
):
ghost_layers
=
[(
ghost_layers
,
ghost_layers
)]
*
len
(
loop_order
)
...
...
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