@@ -90,12 +90,12 @@ public static class RunnerProgram
9090 {
9191 var t = methodArgumentValue . Split ( '.' ) ;
9292 var className = t . Length == 1 ? "" : t [ t . Length - 2 ] ;
93- var methodName = t . Last ( ) ;
93+ var methodName = t . Last ( ) ;
9494 var x = type . GetMethods ( Reflection . allBindingFlags ) ;
9595 method ??= x
9696 . Where ( m => type . FullName . Split ( '.' ) . Last ( ) . Contains ( className ) && m . Name . Contains ( methodName ) )
9797 . MinBy ( m => m . Name . Length ) ;
98- if ( method != null )
98+ if ( method != null )
9999 break ;
100100 }
101101 catch ( Exception )
@@ -132,7 +132,10 @@ private static void EntryPointHandler(
132132 Verbosity verbosity ,
133133 uint recursionThreshold ,
134134 ExplorationMode explorationMode ,
135- string pathToModel )
135+ string pathToModel ,
136+ bool useGPU ,
137+ bool optimize
138+ )
136139 {
137140 var assembly = TryLoadAssembly ( assemblyPath ) ;
138141 var options =
@@ -145,7 +148,9 @@ private static void EntryPointHandler(
145148 verbosity : verbosity ,
146149 recursionThreshold : recursionThreshold ,
147150 explorationMode : explorationMode ,
148- pathToModel : pathToModel ) ;
151+ pathToModel : pathToModel ,
152+ useGPU : useGPU ,
153+ optimize : optimize ) ;
149154
150155 if ( assembly == null ) return ;
151156
@@ -239,7 +244,9 @@ private static void AllPublicMethodsHandler(
239244 Verbosity verbosity ,
240245 uint recursionThreshold ,
241246 ExplorationMode explorationMode ,
242- string pathToModel )
247+ string pathToModel ,
248+ bool useGPU ,
249+ bool optimize )
243250 {
244251 var assembly = TryLoadAssembly ( assemblyPath ) ;
245252 var options =
@@ -252,7 +259,9 @@ private static void AllPublicMethodsHandler(
252259 verbosity : verbosity ,
253260 recursionThreshold : recursionThreshold ,
254261 explorationMode : explorationMode ,
255- pathToModel : pathToModel ) ;
262+ pathToModel : pathToModel ,
263+ useGPU : useGPU ,
264+ optimize : optimize ) ;
256265
257266 if ( assembly == null ) return ;
258267
@@ -276,7 +285,9 @@ private static void PublicMethodsOfTypeHandler(
276285 Verbosity verbosity ,
277286 uint recursionThreshold ,
278287 ExplorationMode explorationMode ,
279- string pathToModel )
288+ string pathToModel ,
289+ bool useGPU ,
290+ bool optimize )
280291 {
281292 var assembly = TryLoadAssembly ( assemblyPath ) ;
282293 if ( assembly == null ) return ;
@@ -298,7 +309,9 @@ private static void PublicMethodsOfTypeHandler(
298309 verbosity : verbosity ,
299310 recursionThreshold : recursionThreshold ,
300311 explorationMode : explorationMode ,
301- pathToModel : pathToModel ) ;
312+ pathToModel : pathToModel ,
313+ useGPU : useGPU ,
314+ optimize : optimize ) ;
302315
303316 Statistics statistics ;
304317 if ( runTests )
@@ -321,7 +334,9 @@ private static void SpecificMethodHandler(
321334 Verbosity verbosity ,
322335 uint recursionThreshold ,
323336 ExplorationMode explorationMode ,
324- string pathToModel )
337+ string pathToModel ,
338+ bool useGPU ,
339+ bool optimize )
325340 {
326341 var assembly = TryLoadAssembly ( assemblyPath ) ;
327342 if ( assembly == null ) return ;
@@ -359,7 +374,9 @@ private static void SpecificMethodHandler(
359374 verbosity : verbosity ,
360375 recursionThreshold : recursionThreshold ,
361376 explorationMode : explorationMode ,
362- pathToModel : pathToModel ) ;
377+ pathToModel : pathToModel ,
378+ useGPU : useGPU ,
379+ optimize : optimize ) ;
363380
364381 Statistics statistics ;
365382 if ( runTests || checkCoverage )
@@ -381,7 +398,9 @@ private static void NamespaceHandler(
381398 Verbosity verbosity ,
382399 uint recursionThreshold ,
383400 ExplorationMode explorationMode ,
384- string pathToModel )
401+ string pathToModel ,
402+ bool useGPU ,
403+ bool optimize )
385404 {
386405 var assembly = TryLoadAssembly ( assemblyPath ) ;
387406 if ( assembly == null ) return ;
@@ -403,7 +422,9 @@ private static void NamespaceHandler(
403422 verbosity : verbosity ,
404423 recursionThreshold : recursionThreshold ,
405424 explorationMode : explorationMode ,
406- pathToModel : pathToModel ) ;
425+ pathToModel : pathToModel ,
426+ useGPU : useGPU ,
427+ optimize : optimize ) ;
407428
408429 Statistics statistics ;
409430 if ( runTests )
@@ -427,6 +448,14 @@ public static int Main(string[] args)
427448 aliases : new [ ] { "--model" , "-m" } ,
428449 ( ) => defaultOptions . GetDefaultPathToModel ( ) ,
429450 "Path to ONNX file with model for AI searcher." ) ;
451+ var useGPUOption = new Option < bool > (
452+ aliases : new [ ] { "--gpu" } ,
453+ ( ) => false ,
454+ "Enables GPU processing." ) ;
455+ var optimizeOption = new Option < bool > (
456+ aliases : new [ ] { "--optimize" } ,
457+ ( ) => false ,
458+ "Optimize option." ) ;
430459 var solverTimeoutOption = new Option < int > (
431460 aliases : new [ ] { "--solver-timeout" , "-st" } ,
432461 ( ) => - 1 ,
@@ -473,6 +502,8 @@ public static int Main(string[] args)
473502 rootCommand . AddGlobalOption ( recursionThresholdOption ) ;
474503 rootCommand . AddGlobalOption ( explorationModeOption ) ;
475504 rootCommand . AddGlobalOption ( pathToModelOption ) ;
505+ rootCommand . AddGlobalOption ( useGPUOption ) ;
506+ rootCommand . AddGlobalOption ( optimizeOption ) ;
476507
477508 var entryPointCommand =
478509 new Command ( "--entry-point" , "Generate test coverage from the entry point of assembly (assembly must contain Main method)" ) ;
@@ -499,7 +530,9 @@ public static int Main(string[] args)
499530 parseResult . GetValueForOption ( verbosityOption ) ,
500531 parseResult . GetValueForOption ( recursionThresholdOption ) ,
501532 parseResult . GetValueForOption ( explorationModeOption ) ,
502- parseResult . GetValueForOption ( pathToModelOption )
533+ parseResult . GetValueForOption ( pathToModelOption ) ,
534+ parseResult . GetValueForOption ( useGPUOption ) ,
535+ parseResult . GetValueForOption ( optimizeOption )
503536 ) ;
504537 } ) ;
505538
@@ -561,7 +594,9 @@ public static int Main(string[] args)
561594 parseResult . GetValueForOption ( verbosityOption ) ,
562595 parseResult . GetValueForOption ( recursionThresholdOption ) ,
563596 parseResult . GetValueForOption ( explorationModeOption ) ,
564- parseResult . GetValueForOption ( pathToModelOption )
597+ parseResult . GetValueForOption ( pathToModelOption ) ,
598+ parseResult . GetValueForOption ( useGPUOption ) ,
599+ parseResult . GetValueForOption ( optimizeOption )
565600 ) ;
566601 } ) ;
567602
@@ -589,7 +624,9 @@ public static int Main(string[] args)
589624 parseResult . GetValueForOption ( verbosityOption ) ,
590625 parseResult . GetValueForOption ( recursionThresholdOption ) ,
591626 parseResult . GetValueForOption ( explorationModeOption ) ,
592- parseResult . GetValueForOption ( pathToModelOption )
627+ parseResult . GetValueForOption ( pathToModelOption ) ,
628+ parseResult . GetValueForOption ( useGPUOption ) ,
629+ parseResult . GetValueForOption ( optimizeOption )
593630 ) ;
594631 } ) ;
595632
@@ -620,7 +657,9 @@ public static int Main(string[] args)
620657 parseResult . GetValueForOption ( verbosityOption ) ,
621658 parseResult . GetValueForOption ( recursionThresholdOption ) ,
622659 parseResult . GetValueForOption ( explorationModeOption ) ,
623- pathToModel
660+ pathToModel ,
661+ parseResult . GetValueForOption ( useGPUOption ) ,
662+ parseResult . GetValueForOption ( optimizeOption )
624663 ) ;
625664 } ) ;
626665
@@ -649,7 +688,9 @@ public static int Main(string[] args)
649688 parseResult . GetValueForOption ( verbosityOption ) ,
650689 parseResult . GetValueForOption ( recursionThresholdOption ) ,
651690 parseResult . GetValueForOption ( explorationModeOption ) ,
652- pathToModel
691+ pathToModel ,
692+ parseResult . GetValueForOption ( useGPUOption ) ,
693+ parseResult . GetValueForOption ( optimizeOption )
653694 ) ;
654695 } ) ;
655696
0 commit comments