Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Apr 16, 2023
1 parent 7bdd36e commit 8a7f0ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/dump-properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def print_info(obj, info_cls):
try:
print(f"{info_name}: {info_value}")
except Exception:
print("%s: <error>" % info_name)
print(f"{info_name}: <error>")


for platform in cl.get_platforms():
Expand Down
9 changes: 3 additions & 6 deletions python/transpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def benchmark_transpose():
mem_bandwidths = {}

methods = [SillyTranspose, NaiveTranspose, TransposeWithLocal]
count = 12
for cls in methods:
name = cls.__name__.replace("Transpose", "")

Expand All @@ -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)

Expand Down

0 comments on commit 8a7f0ee

Please sign in to comment.