Skip to content

Commit 1033b37

Browse files
authored
Merge pull request #2327 from kif/benchmark_with_device_selection
Offer the selection of individual OpenCL devices
2 parents dc9438a + 6f40d3a commit 1033b37

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

CITATION.cff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ authors:
3030
given-names: Frederic Emmanuel
3131
affiliation: Soleil
3232
- family-names: Massahud
33-
given-names: Emily
33+
given-names: Emily
3434
affiliation: ANSTO
3535
- family-names: Payno
3636
given-names: Henri
@@ -50,7 +50,7 @@ authors:
5050
affiliation: ESRF
5151
- family-names: Paleo
5252
given-names: Pierre
53-
affiliation: ESRF
53+
affiliation: ESRF
5454
- family-names: Faure
5555
given-names: Bertrand
5656
affiliation: Xenocs
@@ -64,7 +64,7 @@ authors:
6464
given-names: Christopher J.
6565
affiliation: NSLS-II
6666
- family-names: Hopkins
67-
given-names: Jesse B.
67+
given-names: Jesse B.
6868
orcid: https://orcid.org/0000-0001-8554-8072
6969
affiliation: APS
7070
- family-names: Pascal

src/pyFAI/app/benchmark.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
__contact__ = "[email protected]"
3333
__license__ = "MIT"
3434
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
35-
__date__ = "27/09/2024"
35+
__date__ = "08/11/2024"
3636
__status__ = "development"
3737

3838
from argparse import ArgumentParser
@@ -91,14 +91,12 @@ def main(args=None):
9191
parser.add_argument("--no-1dimention",
9292
action="store_false", dest="onedim", default=True,
9393
help="Do not benchmark algorithms for 1D-regrouping")
94-
9594
parser.add_argument("-m", "--memprof",
9695
action="store_true", dest="memprof", default=False,
9796
help="Perfrom memory profiling (Linux only)")
9897
parser.add_argument("-r", "--repeat",
9998
dest="repeat", default=1, type=int,
10099
help="Repeat each measurement x times to take the best")
101-
102100
parser.add_argument("-ps", "--pixelsplit",
103101
dest="pixelsplit", default=["bbox"], type=str, nargs="+",
104102
help="Benchmark using specific pixel splitting protocols: no, bbox, pseudo, full, all",)
@@ -108,11 +106,12 @@ def main(args=None):
108106
parser.add_argument("-i", "--implementation",
109107
dest="implementation", default=["cython", "opencl"], type=str, nargs="+",
110108
help="Benchmark using specific algorithm implementations: python, cython, opencl, all")
111-
112109
parser.add_argument("-f", "--function",
113110
dest="function", default="ng", type=str,
114111
help="Benchmark legacy (legacy), engine function (ng), or both (all)")
115-
112+
parser.add_argument("-o", "--devices",
113+
dest="devices", default=None, type=str,
114+
help="Comma separated list of paires of OpenCL platform:device ids like `0:1,1:0` to benchmark")
116115
parser.add_argument("--all",
117116
action="store_true", dest="all", default=False,
118117
help="Benchmark using all available methods and devices")
@@ -122,12 +121,16 @@ def main(args=None):
122121
pyFAI_logger.setLevel(logging.DEBUG)
123122

124123
devices = []
125-
if options.opencl_cpu:
126-
devices.append("cpu")
127-
if options.opencl_gpu:
128-
devices.append("gpu")
129-
if options.opencl_acc:
130-
devices.append("acc")
124+
if options.devices:
125+
for pair in options.devices.split(","):
126+
devices.append(pair.split(":"))
127+
else:
128+
if options.opencl_cpu:
129+
devices.append("cpu")
130+
if options.opencl_gpu:
131+
devices.append("gpu")
132+
if options.opencl_acc:
133+
devices.append("acc")
131134

132135
benchmark.run(number=options.number,
133136
repeat=options.repeat,

0 commit comments

Comments
 (0)