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
f69deec7
Commit
f69deec7
authored
Feb 23, 2020
by
Stephan Seitz
Browse files
Avoid calling .get in BoundaryHandling.to_cpu which does not work for OpenCL
parent
dba69a74
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/boundaries/boundaryhandling.py
View file @
f69deec7
...
...
@@ -96,21 +96,21 @@ class BoundaryHandling:
fi
=
flag_interface
self
.
flag_interface
=
fi
if
fi
is
not
None
else
FlagInterface
(
data_handling
,
name
+
"Flags"
)
if
ParallelDataHandling
and
isinstance
(
self
.
data_handling
,
ParallelDataHandling
):
array_handler
=
PyCudaArrayHandler
()
else
:
array_handler
=
self
.
data_handling
.
array_handler
def
to_cpu
(
gpu_version
,
cpu_version
):
gpu_version
=
gpu_version
.
boundary_object_to_index_list
cpu_version
=
cpu_version
.
boundary_object_to_index_list
for
obj
,
cpu_arr
in
cpu_version
.
items
():
gpu_version
[
obj
]
.
get
(
cpu_arr
)
array_handler
.
download
(
gpu_version
[
obj
]
,
cpu_arr
)
def
to_gpu
(
gpu_version
,
cpu_version
):
gpu_version
=
gpu_version
.
boundary_object_to_index_list
cpu_version
=
cpu_version
.
boundary_object_to_index_list
if
ParallelDataHandling
and
isinstance
(
self
.
data_handling
,
ParallelDataHandling
):
array_handler
=
PyCudaArrayHandler
()
else
:
array_handler
=
self
.
data_handling
.
array_handler
for
obj
,
cpu_arr
in
cpu_version
.
items
():
if
obj
not
in
gpu_version
or
gpu_version
[
obj
].
shape
!=
cpu_arr
.
shape
:
gpu_version
[
obj
]
=
array_handler
.
to_gpu
(
cpu_arr
)
...
...
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