From bec5e836ff66fdd963f9d8f53fcee88a638a4e04 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Mon, 29 Jul 2013 11:14:40 -0400 Subject: [PATCH] PEP8 dump_properties --- examples/dump-properties.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/dump-properties.py b/examples/dump-properties.py index 824a7505..7890c941 100644 --- a/examples/dump-properties.py +++ b/examples/dump-properties.py @@ -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: -- GitLab