Skip to content

Commit b2f9dab

Browse files
add preloaded UMF benchmarks (#17278)
Add Unified Memory Framework benchmarks which use preloaded libraries.
1 parent d957299 commit b2f9dab

File tree

1 file changed

+25
-2
lines changed
  • unified-runtime/scripts/benchmarks/benches

1 file changed

+25
-2
lines changed

unified-runtime/scripts/benchmarks/benches/umf.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def benchmarks(self) -> list[Benchmark]:
4040
benches = [
4141
GBench(self),
4242
GBenchUmfProxy(self),
43+
GBenchJemalloc(self),
44+
GBenchTbbProxy(self),
4345
]
4446

4547
return benches
@@ -220,10 +222,31 @@ def parse_output(self, output):
220222
return results
221223

222224

223-
class GBenchUmfProxy(GBenchPreloaded):
225+
class GBenchGlibc(GBenchPreloaded):
226+
def __init__(self, bench, replacing_lib):
227+
super().__init__(bench, lib_to_be_replaced="glibc", replacing_lib=replacing_lib)
228+
229+
230+
class GBenchUmfProxy(GBenchGlibc):
224231
def __init__(self, bench):
225-
super().__init__(bench, lib_to_be_replaced="glibc", replacing_lib="umfProxy")
232+
super().__init__(bench, replacing_lib="umfProxy")
226233

227234
def extra_env_vars(self) -> dict:
228235
umf_proxy_path = os.path.join(options.umf, "lib", "libumf_proxy.so")
229236
return {"LD_PRELOAD": umf_proxy_path}
237+
238+
239+
class GBenchJemalloc(GBenchGlibc):
240+
def __init__(self, bench):
241+
super().__init__(bench, replacing_lib="jemalloc")
242+
243+
def extra_env_vars(self) -> dict:
244+
return {"LD_PRELOAD": "libjemalloc.so"}
245+
246+
247+
class GBenchTbbProxy(GBenchGlibc):
248+
def __init__(self, bench):
249+
super().__init__(bench, replacing_lib="tbbProxy")
250+
251+
def extra_env_vars(self) -> dict:
252+
return {"LD_PRELOAD": "libtbbmalloc_proxy.so"}

0 commit comments

Comments
 (0)