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
Commits
4f1d2c94
Commit
4f1d2c94
authored
2 years ago
by
Michael Kuron
Browse files
Options
Downloads
Patches
Plain Diff
Remove pystencils.GPU_DEVICE
parent
7a7d351c
No related branches found
No related tags found
1 merge request
!146
Remove pystencils.GPU_DEVICE
Pipeline
#54183
failed
2 years ago
Stage: pretest
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lbmpy/max_domain_size_info.py
+5
-15
5 additions, 15 deletions
lbmpy/max_domain_size_info.py
lbmpy_tests/test_gpu_block_size_limiting.py
+1
-1
1 addition, 1 deletion
lbmpy_tests/test_gpu_block_size_limiting.py
with
6 additions
and
16 deletions
lbmpy/max_domain_size_info.py
+
5
−
15
View file @
4f1d2c94
...
...
@@ -26,7 +26,6 @@ Examples:
import
warnings
import
numpy
as
np
import
pystencils
# Optional packages cpuinfo, cupy and psutil for hardware queries
try
:
...
...
@@ -36,19 +35,8 @@ except ImportError:
try
:
import
cupy
device
=
cupy
.
cuda
.
Device
(
pystencils
.
GPU_DEVICE
)
except
ImportError
:
cupy
=
None
device
=
None
if
cupy
:
try
:
device
=
cupy
.
cuda
.
Device
(
pystencils
.
GPU_DEVICE
)
except
AttributeError
:
warnings
.
warn
(
"
You are using an old pystencils version. Consider updating it
"
)
device
=
cupy
.
cuda
.
Device
(
0
)
else
:
device
=
None
try
:
from
psutil
import
virtual_memory
...
...
@@ -125,9 +113,11 @@ def memory_sizes_of_current_machine():
if
'
l3_cache_size
'
in
cpu_info
:
result
[
'
L3
'
]
=
cpu_info
[
'
l3_cache_size
'
]
if
device
:
size
=
device
.
mem_info
[
1
]
/
(
1024
*
1024
)
result
[
'
GPU
'
]
=
"
{0:.0f} MB
"
.
format
(
size
)
if
cupy
:
for
i
in
range
(
cupy
.
cuda
.
runtime
.
getDeviceCount
()):
device
=
cupy
.
cuda
.
Device
(
i
)
size
=
device
.
mem_info
[
1
]
/
(
1024
*
1024
)
result
[
f
'
GPU
{
i
}
'
]
=
"
{0:.0f} MB
"
.
format
(
size
)
if
virtual_memory
:
mem
=
virtual_memory
()
...
...
This diff is collapsed.
Click to expand it.
lbmpy_tests/test_gpu_block_size_limiting.py
+
1
−
1
View file @
4f1d2c94
...
...
@@ -17,5 +17,5 @@ def test_gpu_block_size_limiting():
kernel
=
ast
.
compile
()
assert
all
(
b
<
too_large
for
b
in
limited_block_size
[
'
block
'
])
bs
=
[
too_large
,
too_large
,
too_large
]
ast
.
indexing
.
limit_block_size_by_register_restriction
(
bs
,
kernel
.
num_regs
)
bs
=
ast
.
indexing
.
limit_block_size_by_register_restriction
(
bs
,
kernel
.
num_regs
)
assert
all
(
b
<
too_large
for
b
in
bs
)
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