Skip to content

Commit 6f9229b

Browse files
committed
add main entry point
1 parent 5f3fc18 commit 6f9229b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

benchmark/benchmarks.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Load benchmark code
2+
include("MPSKitBenchmarks/MPSKitBenchmarks.jl")
3+
const SUITE = MPSKitBenchmarks.SUITE
4+
5+
# Populate benchmarks
6+
# Detect if user supplied extra arguments to load only specific modules
7+
# e.g. julia benchmarks.jl --modules=linalg,tensornetworks
8+
modules_pattern = r"(?:--modules=)(\w+)"
9+
arg_id = findfirst(contains(modules_pattern), ARGS)
10+
if isnothing(arg_id)
11+
MPSKitBenchmarks.loadall!()
12+
else
13+
modules = split(only(match(modules_pattern, ARGS[arg_id]).captures[1]), ",")
14+
for m in modules
15+
MPSKitBenchmarks.load!(m)
16+
end
17+
end

0 commit comments

Comments
 (0)