Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lbmpy
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
pycodegen
lbmpy
Merge requests
!25
Actually test GPU in test_boundary_handling.test_simple
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Actually test GPU in test_boundary_handling.test_simple
seitz/lbmpy:test-gpu-in-gpu-test
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Stephan Seitz
requested to merge
seitz/lbmpy:test-gpu-in-gpu-test
into
master
5 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Was only allocating buffers for GPU but then doing boundary handling on CPU
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
020315cf
1 commit,
5 years ago
1 file
+
18
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
lbmpy_tests/test_boundary_handling.py
+
18
−
10
Options
import
numpy
as
np
import
pytest
from
lbmpy.boundaries
import
UBB
,
NeumannByCopy
,
NoSlip
,
StreamInConstant
@@ -10,15 +9,24 @@ from lbmpy.lbstep import LatticeBoltzmannStep
from
pystencils
import
create_data_handling
,
make_slice
@pytest.mark.parametrize
(
"
gpu
"
,
[
True
,
False
])
def
test_simple
(
gpu
):
import
pytest
pytest
.
importorskip
(
'
pycuda
'
)
dh
=
create_data_handling
((
10
,
5
),
parallel
=
False
)
dh
.
add_array
(
'
pdfs
'
,
values_per_cell
=
9
,
cpu
=
True
,
gpu
=
gpu
)
lb_func
=
create_lb_function
(
stencil
=
'
D2Q9
'
,
compressible
=
False
,
relaxation_rate
=
1.8
)
bh
=
LatticeBoltzmannBoundaryHandling
(
lb_func
.
method
,
dh
,
'
pdfs
'
)
@pytest.mark.parametrize
(
"
target
"
,
[
'
cpu
'
,
'
gpu
'
,
'
opencl
'
])
def
test_simple
(
target
):
if
target
==
'
gpu
'
:
import
pytest
pytest
.
importorskip
(
'
pycuda
'
)
elif
target
==
'
opencl
'
:
import
pytest
pytest
.
importorskip
(
'
pyopencl
'
)
import
pystencils.opencl.autoinit
dh
=
create_data_handling
((
10
,
5
),
parallel
=
False
,
default_target
=
target
)
dh
.
add_array
(
'
pdfs
'
,
values_per_cell
=
9
,
cpu
=
True
,
gpu
=
target
!=
'
cpu
'
)
lb_func
=
create_lb_function
(
stencil
=
'
D2Q9
'
,
compressible
=
False
,
relaxation_rate
=
1.8
,
optimization
=
{
'
target
'
:
target
})
bh
=
LatticeBoltzmannBoundaryHandling
(
lb_func
.
method
,
dh
,
'
pdfs
'
,
target
=
target
)
wall
=
NoSlip
()
moving_wall
=
UBB
((
0.001
,
0
))
Loading