Skip to content

Commit

Permalink
update benchmark code for newer root
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed Nov 26, 2023
1 parent 0963ae0 commit bec0d46
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bench/test_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ def run():
@pytest.mark.parametrize("n", N)
@pytest.mark.parametrize("BatchMode", [False, True])
@pytest.mark.parametrize("NumCPU", [0, nb.get_num_threads()])
def test_RooFit(benchmark, n, BatchMode, NumCPU):
@pytest.mark.parametrize("EvalBackend", ["legacy", "cpu"])
def test_RooFit(benchmark, n, BatchMode, NumCPU, EvalBackend):
import ROOT as R

x = R.RooRealVar("x", "x", 0, 1)
Expand All @@ -232,7 +233,11 @@ def run():
sigma.setVal(0.1)
slope.setVal(1)
z.setVal(0.5)
args = [R.RooFit.PrintLevel(-1), R.RooFit.BatchMode(BatchMode)]
args = [
R.RooFit.PrintLevel(-1),
R.RooFit.BatchMode(BatchMode),
R.RooFit.EvalBackend(EvalBackend),
]
if NumCPU:
args.append(R.RooFit.NumCPU(NumCPU))
pdf.fitTo(data, *args)
Expand Down

0 comments on commit bec0d46

Please sign in to comment.