Skip to content

Commit 5ee4337

Browse files
committed
add get_adapter_full_path
1 parent 770a2db commit 5ee4337

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

scripts/benchmarks/benches/base.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,21 @@
1515
class Benchmark:
1616
def __init__(self, directory):
1717
self.directory = directory
18+
19+
@staticmethod
20+
def get_adapter_full_path():
1821
for libs_dir_name in ['lib', 'lib64']:
19-
self.adapter_path = os.path.join(
22+
adapter_path = os.path.join(
2023
options.ur_dir, libs_dir_name, f"libur_adapter_{options.ur_adapter_name}.so")
21-
if os.path.isfile(self.adapter_path):
22-
print(f"using adapter {self.adapter_path}")
23-
return
24-
assert os.path.isfile(self.adapter_path), \
25-
f"could not find adapter file {self.adapter_path} (and in similar lib paths)"
24+
if os.path.isfile(adapter_path):
25+
return adapter_path
26+
assert False, \
27+
f"could not find adapter file {adapter_path} (and in similar lib paths)"
2628

2729
def run_bench(self, command, env_vars):
2830
env_vars_with_forced_adapter = env_vars.copy()
29-
env_vars_with_forced_adapter.update({'UR_ADAPTERS_FORCE_LOAD': self.adapter_path})
31+
env_vars_with_forced_adapter.update(
32+
{'UR_ADAPTERS_FORCE_LOAD': Benchmark.get_adapter_full_path()})
3033
return run(
3134
command=command,
3235
env_vars=env_vars_with_forced_adapter,

scripts/benchmarks/benches/compute.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class ComputeBench:
1515
def __init__(self, directory):
1616
self.directory = directory
1717
self.built = False
18-
return
1918

2019
def setup(self):
2120
if self.built:

0 commit comments

Comments
 (0)