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
Sebastian Bindgen
pystencils
Commits
a4e8ce0c
Commit
a4e8ce0c
authored
4 years ago
by
Sebastian Bindgen
Browse files
Options
Downloads
Patches
Plain Diff
Usage of custom boundary functor if given
parent
e20f82a3
No related branches found
No related tags found
No related merge requests found
Pipeline
#28607
passed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils/datahandling/serial_datahandling.py
+16
-13
16 additions, 13 deletions
pystencils/datahandling/serial_datahandling.py
with
16 additions
and
13 deletions
pystencils/datahandling/serial_datahandling.py
+
16
−
13
View file @
a4e8ce0c
...
@@ -271,7 +271,7 @@ class SerialDataHandling(DataHandling):
...
@@ -271,7 +271,7 @@ class SerialDataHandling(DataHandling):
def
synchronization_function_gpu
(
self
,
names
,
stencil_name
=
None
,
**
_
):
def
synchronization_function_gpu
(
self
,
names
,
stencil_name
=
None
,
**
_
):
return
self
.
synchronization_function
(
names
,
stencil_name
,
target
=
'
gpu
'
)
return
self
.
synchronization_function
(
names
,
stencil_name
,
target
=
'
gpu
'
)
def
synchronization_function
(
self
,
names
,
stencil
=
None
,
target
=
None
,
**
_
):
def
synchronization_function
(
self
,
names
,
stencil
=
None
,
target
=
None
,
functor
=
None
,
**
_
):
if
target
is
None
:
if
target
is
None
:
target
=
self
.
default_target
target
=
self
.
default_target
if
target
==
'
opencl
'
:
if
target
==
'
opencl
'
:
...
@@ -311,19 +311,22 @@ class SerialDataHandling(DataHandling):
...
@@ -311,19 +311,22 @@ class SerialDataHandling(DataHandling):
if
len
(
filtered_stencil
)
>
0
:
if
len
(
filtered_stencil
)
>
0
:
if
target
==
'
cpu
'
:
if
target
==
'
cpu
'
:
from
pystencils.slicing
import
get_periodic_boundary_functor
if
functor
is
None
:
result
.
append
(
get_periodic_boundary_functor
(
filtered_stencil
,
ghost_layers
=
gls
))
from
pystencils.slicing
import
get_periodic_boundary_functor
functor
=
get_periodic_boundary_functor
result
.
append
(
functor
(
filtered_stencil
,
ghost_layers
=
gls
))
else
:
else
:
from
pystencils.gpucuda.periodicity
import
get_periodic_boundary_functor
as
boundary_func
if
functor
is
None
:
target
=
'
gpu
'
if
not
isinstance
(
self
.
array_handler
,
PyOpenClArrayHandler
)
else
'
opencl
'
from
pystencils.gpucuda.periodicity
import
get_periodic_boundary_functor
as
functor
result
.
append
(
boundary_func
(
filtered_stencil
,
self
.
_domainSize
,
target
=
'
gpu
'
if
not
isinstance
(
self
.
array_handler
,
PyOpenClArrayHandler
)
else
'
opencl
'
index_dimensions
=
self
.
fields
[
name
].
index_dimensions
,
result
.
append
(
functor
(
filtered_stencil
,
self
.
_domainSize
,
index_dim_shape
=
values_per_cell
,
index_dimensions
=
self
.
fields
[
name
].
index_dimensions
,
dtype
=
self
.
fields
[
name
].
dtype
.
numpy_dtype
,
index_dim_shape
=
values_per_cell
,
ghost_layers
=
gls
,
dtype
=
self
.
fields
[
name
].
dtype
.
numpy_dtype
,
target
=
target
,
ghost_layers
=
gls
,
opencl_queue
=
self
.
_opencl_queue
,
target
=
target
,
opencl_ctx
=
self
.
_opencl_ctx
))
opencl_queue
=
self
.
_opencl_queue
,
opencl_ctx
=
self
.
_opencl_ctx
))
if
target
==
'
cpu
'
:
if
target
==
'
cpu
'
:
def
result_functor
():
def
result_functor
():
...
...
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