Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyopencl
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timothy Smith
pyopencl
Commits
bec5e836
Commit
bec5e836
authored
11 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
PEP8 dump_properties
parent
17f4d871
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/dump-properties.py
+12
-4
12 additions, 4 deletions
examples/dump-properties.py
with
12 additions
and
4 deletions
examples/dump-properties.py
+
12
−
4
View file @
bec5e836
...
...
@@ -7,6 +7,7 @@ parser.add_option("-s", "--short", action="store_true",
(
options
,
args
)
=
parser
.
parse_args
()
def
print_info
(
obj
,
info_cls
):
for
info_name
in
sorted
(
dir
(
info_cls
)):
if
not
info_name
.
startswith
(
"
_
"
)
and
info_name
!=
"
to_string
"
:
...
...
@@ -20,7 +21,8 @@ def print_info(obj, info_cls):
and
isinstance
(
info_value
,
list
)):
print
(
"
%s: %s
"
%
(
info_name
,
[
cl
.
device_partition_property_ext
.
to_string
(
v
,
"
<unknown device partition property %d>
"
)
for
v
in
info_value
]))
"
<unknown device partition property %d>
"
)
for
v
in
info_value
]))
else
:
try
:
print
(
"
%s: %s
"
%
(
info_name
,
info_value
))
...
...
@@ -42,9 +44,15 @@ for platform in cl.get_platforms():
print
(
75
*
"
-
"
)
print_info
(
device
,
cl
.
device_info
)
ctx
=
cl
.
Context
([
device
])
#for mf in [cl.mem_flags.READ_ONLY, cl.mem_flags.READ_WRITE, cl.mem_flags.WRITE_ONLY]:
for
mf
in
[
cl
.
mem_flags
.
READ_ONLY
]:
for
itype
in
[
cl
.
mem_object_type
.
IMAGE2D
,
cl
.
mem_object_type
.
IMAGE3D
]:
for
mf
in
[
cl
.
mem_flags
.
READ_ONLY
,
#cl.mem_flags.READ_WRITE,
#cl.mem_flags.WRITE_ONLY
]:
for
itype
in
[
cl
.
mem_object_type
.
IMAGE2D
,
cl
.
mem_object_type
.
IMAGE3D
]:
try
:
formats
=
cl
.
get_supported_image_formats
(
ctx
,
mf
,
itype
)
except
:
...
...
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