Skip to content

Commit c17eb65

Browse files
committed
fix: formatting issues
1 parent ffc7d06 commit c17eb65

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

benchmarks/benchmarks/binary.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import dpctl
22
import dpctl.tensor as dpt
33

4-
SHARED_QUEUE = dpctl.SyclQueue(property='enable_profiling')
4+
SHARED_QUEUE = dpctl.SyclQueue(property="enable_profiling")
5+
56

67
class Binary:
78
"""Benchmark class for binary operations on SYCL devices."""
9+
810
timeout = 300.0
911

1012
def setup(self):
@@ -13,9 +15,9 @@ def setup(self):
1315
self.iterations = 1
1416
self.n_values = 10**8
1517

16-
1718
def run_bench(self, q, reps, n_max, dtype1, dtype2, op):
1819
"""Run the benchmark for a specific function and dtype combination."""
20+
1921
def get_sizes(n):
2022
s = []
2123
m = 8192
@@ -25,7 +27,6 @@ def get_sizes(n):
2527
s.append(n)
2628
return s
2729

28-
2930
x1 = dpt.ones(n_max, dtype=dtype1, sycl_queue=q)
3031
x2 = dpt.ones(n_max, dtype=dtype2, sycl_queue=q)
3132
r = op(x1, x2)
@@ -42,7 +43,9 @@ def get_sizes(n):
4243
n_iters = int((max_bytes / n_bytes) * reps)
4344

4445
while True:
45-
timer = dpctl.SyclTimer(device_timer="order_manager", time_scale=1e9)
46+
timer = dpctl.SyclTimer(
47+
device_timer="order_manager", time_scale=1e9
48+
)
4649
with timer(q):
4750
for _ in range(n_iters):
4851
op(x1_n, x2_n, out=r_n)
@@ -99,7 +102,9 @@ def get_sizes(n):
99102

100103
# Dynamically create benchmark methods at the module level
101104
def generate_benchmark_functions():
102-
"""Dynamically create benchmark functions for each function and dtype combination."""
105+
"""Dynamically create benchmark functions for each
106+
function and dtype combination.
107+
"""
103108
for fn in function_list:
104109
fn_name = fn.name_
105110
for dtype1, dtype2 in dtypes[fn]:
@@ -122,4 +127,4 @@ def benchmark_method(self, fn=fn, dtype1=dtype1, dtype2=dtype2):
122127

123128

124129
# Generate the benchmark functions
125-
generate_benchmark_functions()
130+
generate_benchmark_functions()

benchmarks/benchmarks/ef_bench_add.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import dpctl
22
import dpctl.tensor as dpt
3-
import dpctl.utils as dpu
43
import dpctl.tensor._tensor_elementwise_impl as tei
4+
import dpctl.utils as dpu
5+
56

67
class EfBenchAdd:
78

89
def time_ef_bench_add(self):
9-
q = dpctl.SyclQueue(property='enable_profiling')
10+
q = dpctl.SyclQueue(property="enable_profiling")
1011
n = 2**26
1112
reps = 50
1213

@@ -24,6 +25,7 @@ def time_ef_bench_add(self):
2425
with timer(q):
2526
for _ in range(reps):
2627
deps = m.submitted_events
27-
ht_e, c_e = op2(src1=x1, src2=x2, dst=r, sycl_queue=q, depends=deps)
28+
ht_e, c_e = op2(
29+
src1=x1, src2=x2, dst=r, sycl_queue=q, depends=deps
30+
)
2831
m.add_event_pair(ht_e, c_e)
29-

0 commit comments

Comments
 (0)