Skip to content

Commit 7acc273

Browse files
committed
fix: review suggestions
1 parent d9f4ace commit 7acc273

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

benchmarks/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ conda activate dpctl_env
1616
asv run --environment existing:/full/mamba/path/envs/dpctl_env/bin/python
1717
```
1818

19+
For `level_zero` devices, you might see `USM Allocation` errors unless you use the `asv run` command with `--launch-method spawn`
20+
1921
## Writing new benchmarks
2022
Read ASV's guidelines for writing benchmarks [here](https://asv.readthedocs.io/en/stable/writing_benchmarks.html)

benchmarks/benchmarks/benchmark_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from asv_runner.benchmarks.mark import SkipNotImplemented
2+
import dpctl.tensor as dpt
23

3-
4-
def skip_unsupported_datatype(queue, dtype):
4+
def skip_unsupported_dtype(q, dtype):
55
"""
66
Skip the benchmark if the device does not support the given data type.
77
"""
88
if (
9-
(dtype.name == "float64" or dtype.name == "complex128")
10-
and not queue.sycl_device.has_aspect_fp64
11-
) or (dtype.name == "float16" and not queue.sycl_device.has_aspect_fp16):
9+
(dtype == dpt.float64 or dtype.name == dpt.complex128)
10+
and not q.sycl_device.has_aspect_fp64
11+
) or (dtype == dpt.float16 and not q.sycl_device.has_aspect_fp16):
1212
raise SkipNotImplemented(
1313
f"Skipping benchmark for {dtype.name} on this device"
1414
+ " as it is not supported."

benchmarks/benchmarks/binary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def generate_benchmark_functions():
114114
method_name = f"time_{fn_name}_{dtype1.name}_{dtype2.name}"
115115

116116
def benchmark_method(self, fn=fn, dtype1=dtype1, dtype2=dtype2):
117-
bench_utils.skip_unsupported_datatype(self.q, dtype1)
117+
bench_utils.skip_unsupported_dtype(self.q, dtype1)
118118
return self.run_bench(
119119
self.q,
120120
self.iterations,

0 commit comments

Comments
 (0)