@@ -726,6 +726,7 @@ mod desc {
726
726
pub ( crate ) const parse_list_with_polarity: & str =
727
727
"a comma-separated list of strings, with elements beginning with + or -" ;
728
728
pub ( crate ) const parse_autodiff: & str = "a comma separated list of settings: `Enable`, `PrintSteps`, `PrintTA`, `PrintTAFn`, `PrintAA`, `PrintPerf`, `PrintModBefore`, `PrintModAfter`, `PrintModFinal`, `PrintPasses`, `NoPostopt`, `LooseTypes`, `Inline`" ;
729
+ pub ( crate ) const parse_offload: & str = "a comma separated list of settings: `Enable`" ;
729
730
pub ( crate ) const parse_comma_list: & str = "a comma-separated list of strings" ;
730
731
pub ( crate ) const parse_opt_comma_list: & str = parse_comma_list;
731
732
pub ( crate ) const parse_number: & str = "a number" ;
@@ -1357,6 +1358,27 @@ pub mod parse {
1357
1358
}
1358
1359
}
1359
1360
1361
+ pub ( crate ) fn parse_offload ( slot : & mut Vec < Offload > , v : Option < & str > ) -> bool {
1362
+ let Some ( v) = v else {
1363
+ * slot = vec ! [ ] ;
1364
+ return true ;
1365
+ } ;
1366
+ let mut v: Vec < & str > = v. split ( "," ) . collect ( ) ;
1367
+ v. sort_unstable ( ) ;
1368
+ for & val in v. iter ( ) {
1369
+ let variant = match val {
1370
+ "Enable" => Offload :: Enable ,
1371
+ _ => {
1372
+ // FIXME(ZuseZ4): print an error saying which value is not recognized
1373
+ return false ;
1374
+ }
1375
+ } ;
1376
+ slot. push ( variant) ;
1377
+ }
1378
+
1379
+ true
1380
+ }
1381
+
1360
1382
pub ( crate ) fn parse_autodiff ( slot : & mut Vec < AutoDiff > , v : Option < & str > ) -> bool {
1361
1383
let Some ( v) = v else {
1362
1384
* slot = vec ! [ ] ;
@@ -2399,6 +2421,11 @@ options! {
2399
2421
"do not use unique names for text and data sections when -Z function-sections is used" ) ,
2400
2422
normalize_docs: bool = ( false , parse_bool, [ TRACKED ] ,
2401
2423
"normalize associated items in rustdoc when generating documentation" ) ,
2424
+ offload: Vec <crate :: config:: Offload > = ( Vec :: new( ) , parse_offload, [ TRACKED ] ,
2425
+ "a list of offload flags to enable
2426
+ Mandatory setting:
2427
+ `=Enable`
2428
+ Currently the only option available" ) ,
2402
2429
on_broken_pipe: OnBrokenPipe = ( OnBrokenPipe :: Default , parse_on_broken_pipe, [ TRACKED ] ,
2403
2430
"behavior of std::io::ErrorKind::BrokenPipe (SIGPIPE)" ) ,
2404
2431
oom: OomStrategy = ( OomStrategy :: Abort , parse_oom_strategy, [ TRACKED ] ,
0 commit comments