diff --git a/python/dump-properties.py b/python/dump-properties.py index 3ca409b6..eef01715 100644 --- a/python/dump-properties.py +++ b/python/dump-properties.py @@ -27,7 +27,7 @@ def print_info(obj, info_cls): try: print(f"{info_name}: {info_value}") except Exception: - print("%s: " % info_name) + print(f"{info_name}: ") for platform in cl.get_platforms(): diff --git a/python/transpose.py b/python/transpose.py index 30d1a7a4..0727e68a 100644 --- a/python/transpose.py +++ b/python/transpose.py @@ -169,6 +169,7 @@ def benchmark_transpose(): mem_bandwidths = {} methods = [SillyTranspose, NaiveTranspose, TransposeWithLocal] + count = 12 for cls in methods: name = cls.__name__.replace("Transpose", "") @@ -183,14 +184,10 @@ def benchmark_transpose(): a_t_buf = cl.Buffer(ctx, mf.WRITE_ONLY, size=source.nbytes) method = cls(ctx) - for i in range(4): + for _ in range(4): method(queue, a_t_buf, a_buf, source.shape) - count = 12 - events = [] - for i in range(count): - events.append(method(queue, a_t_buf, a_buf, source.shape)) - + events = [method(queue, a_t_buf, a_buf, source.shape) for _ in range(count)] events[-1].wait() time = sum(evt.profile.end - evt.profile.start for evt in events)