@@ -720,6 +720,7 @@ mod desc {
720
720
pub ( crate ) const parse_list_with_polarity: & str =
721
721
"a comma-separated list of strings, with elements beginning with + or -" ;
722
722
pub ( crate ) const parse_autodiff: & str = "a comma separated list of settings: `Enable`, `PrintSteps`, `PrintTA`, `PrintAA`, `PrintPerf`, `PrintModBefore`, `PrintModAfter`, `PrintModFinal`, `PrintPasses`, `NoPostopt`, `LooseTypes`, `Inline`" ;
723
+ pub ( crate ) const parse_offload: & str = "a comma separated list of settings: `Enable`" ;
723
724
pub ( crate ) const parse_comma_list: & str = "a comma-separated list of strings" ;
724
725
pub ( crate ) const parse_opt_comma_list: & str = parse_comma_list;
725
726
pub ( crate ) const parse_number: & str = "a number" ;
@@ -1351,6 +1352,27 @@ pub mod parse {
1351
1352
}
1352
1353
}
1353
1354
1355
+ pub ( crate ) fn parse_offload ( slot : & mut Vec < Offload > , v : Option < & str > ) -> bool {
1356
+ let Some ( v) = v else {
1357
+ * slot = vec ! [ ] ;
1358
+ return true ;
1359
+ } ;
1360
+ let mut v: Vec < & str > = v. split ( "," ) . collect ( ) ;
1361
+ v. sort_unstable ( ) ;
1362
+ for & val in v. iter ( ) {
1363
+ let variant = match val {
1364
+ "Enable" => Offload :: Enable ,
1365
+ _ => {
1366
+ // FIXME(ZuseZ4): print an error saying which value is not recognized
1367
+ return false ;
1368
+ }
1369
+ } ;
1370
+ slot. push ( variant) ;
1371
+ }
1372
+
1373
+ true
1374
+ }
1375
+
1354
1376
pub ( crate ) fn parse_autodiff ( slot : & mut Vec < AutoDiff > , v : Option < & str > ) -> bool {
1355
1377
let Some ( v) = v else {
1356
1378
* slot = vec ! [ ] ;
@@ -2378,6 +2400,11 @@ options! {
2378
2400
"do not use unique names for text and data sections when -Z function-sections is used" ) ,
2379
2401
normalize_docs: bool = ( false , parse_bool, [ TRACKED ] ,
2380
2402
"normalize associated items in rustdoc when generating documentation" ) ,
2403
+ offload: Vec <crate :: config:: Offload > = ( Vec :: new( ) , parse_offload, [ TRACKED ] ,
2404
+ "a list of offload flags to enable
2405
+ Mandatory setting:
2406
+ `=Enable`
2407
+ Currently the only option available" ) ,
2381
2408
on_broken_pipe: OnBrokenPipe = ( OnBrokenPipe :: Default , parse_on_broken_pipe, [ TRACKED ] ,
2382
2409
"behavior of std::io::ErrorKind::BrokenPipe (SIGPIPE)" ) ,
2383
2410
oom: OomStrategy = ( OomStrategy :: Abort , parse_oom_strategy, [ TRACKED ] ,
0 commit comments