Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer the selection of individual OpenCL devices #2327

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ authors:
given-names: Frederic Emmanuel
affiliation: Soleil
- family-names: Massahud
given-names: Emily
given-names: Emily
affiliation: ANSTO
- family-names: Payno
given-names: Henri
Expand All @@ -50,7 +50,7 @@ authors:
affiliation: ESRF
- family-names: Paleo
given-names: Pierre
affiliation: ESRF
affiliation: ESRF
- family-names: Faure
given-names: Bertrand
affiliation: Xenocs
Expand All @@ -64,7 +64,7 @@ authors:
given-names: Christopher J.
affiliation: NSLS-II
- family-names: Hopkins
given-names: Jesse B.
given-names: Jesse B.
orcid: https://orcid.org/0000-0001-8554-8072
affiliation: APS
- family-names: Pascal
Expand Down
25 changes: 14 additions & 11 deletions src/pyFAI/app/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "27/09/2024"
__date__ = "08/11/2024"
__status__ = "development"

from argparse import ArgumentParser
Expand Down Expand Up @@ -91,14 +91,12 @@ def main(args=None):
parser.add_argument("--no-1dimention",
action="store_false", dest="onedim", default=True,
help="Do not benchmark algorithms for 1D-regrouping")

parser.add_argument("-m", "--memprof",
action="store_true", dest="memprof", default=False,
help="Perfrom memory profiling (Linux only)")
parser.add_argument("-r", "--repeat",
dest="repeat", default=1, type=int,
help="Repeat each measurement x times to take the best")

parser.add_argument("-ps", "--pixelsplit",
dest="pixelsplit", default=["bbox"], type=str, nargs="+",
help="Benchmark using specific pixel splitting protocols: no, bbox, pseudo, full, all",)
Expand All @@ -108,11 +106,12 @@ def main(args=None):
parser.add_argument("-i", "--implementation",
dest="implementation", default=["cython", "opencl"], type=str, nargs="+",
help="Benchmark using specific algorithm implementations: python, cython, opencl, all")

parser.add_argument("-f", "--function",
dest="function", default="ng", type=str,
help="Benchmark legacy (legacy), engine function (ng), or both (all)")

parser.add_argument("-o", "--devices",
dest="devices", default=None, type=str,
help="Comma separated list of paires of OpenCL platform:device ids like `0:1,1:0` to benchmark")
parser.add_argument("--all",
action="store_true", dest="all", default=False,
help="Benchmark using all available methods and devices")
Expand All @@ -122,12 +121,16 @@ def main(args=None):
pyFAI_logger.setLevel(logging.DEBUG)

devices = []
if options.opencl_cpu:
devices.append("cpu")
if options.opencl_gpu:
devices.append("gpu")
if options.opencl_acc:
devices.append("acc")
if options.devices:
for pair in options.devices.split(","):
devices.append(pair.split(":"))
else:
if options.opencl_cpu:
devices.append("cpu")
if options.opencl_gpu:
devices.append("gpu")
if options.opencl_acc:
devices.append("acc")

benchmark.run(number=options.number,
repeat=options.repeat,
Expand Down