32323333__license__ = "MIT"
3434__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
35- __date__ = "27/09 /2024"
35+ __date__ = "08/11 /2024"
3636__status__ = "development"
3737
3838from 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