Skip to content

Commit

Permalink
add benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbowen42 committed Jan 23, 2025
1 parent 24785da commit 7611aa8
Show file tree
Hide file tree
Showing 4 changed files with 435 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "RAJAPerf"]
path = benchmarks/RAJAPerf
url = [email protected]:Olympus-HPC/RAJAPerf.git
1 change: 1 addition & 0 deletions benchmarks/RAJAPerf
Submodule RAJAPerf added at 65934f
15 changes: 9 additions & 6 deletions driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,14 @@ def get_hash(x):


class Executor:
def __init__(self, benchmark, path, exemode, inputs, cc, proteus_path, env_configs):
def __init__(self, benchmark, path, exemode, build_command, inputs, cc, proteus_path, env_configs):
self.benchmark = benchmark
self.path = path
self.exemode = exemode
self.exemode = exemod
# the build command is meant to be a full bash command to build the benchmark, eg
# `cmake -DCMAKE_BUILD_TYPE=Debug --build` or `make benchmark`
# If none is provided, it will default to `make`
self.build_command = 'make' if build_command == None else build_command
self.inputs = inputs
self.cc = cc
self.proteus_path = proteus_path
Expand Down Expand Up @@ -181,9 +185,8 @@ def clean(self):
cmd = "make clean"
self.execute_command(cmd)

def build(self, do_jit):
def build(self, cmd, do_jit):
os.chdir(self.path)
cmd = "make"
env = os.environ.copy()
env["ENABLE_PROTEUS"] = "yes" if do_jit else "no"
env["PROTEUS_PATH"] = self.proteus_path
Expand All @@ -200,7 +203,7 @@ def build(self, do_jit):
t2 = time.perf_counter()
return t2 - t1

def build_and_run(self, reps, profiler=None):
def build_and_run(self, build_command, reps, profiler=None):
os.chdir(self.path)

results = pd.DataFrame()
Expand All @@ -215,7 +218,7 @@ def build_and_run(self, reps, profiler=None):
self.clean()
print("BUILD", self.path, "type", self.exemode)

ctime = self.build(self.exemode != "aot")
ctime = self.build(build_command, self.exemode != "aot")
exe_size = Path(f"{self.path}/{exe}").stat().st_size
print("=> BUILT")

Expand Down
Loading

0 comments on commit 7611aa8

Please sign in to comment.