@@ -4,7 +4,6 @@ use std::{
4
4
ffi:: { CStr , CString } ,
5
5
fmt:: Display ,
6
6
mem:: MaybeUninit ,
7
- ptr:: null_mut,
8
7
str:: FromStr ,
9
8
} ;
10
9
@@ -255,6 +254,11 @@ impl FromStr for NvvmOption {
255
254
"72" => NvvmArch :: Compute72 ,
256
255
"75" => NvvmArch :: Compute75 ,
257
256
"80" => NvvmArch :: Compute80 ,
257
+ "86" => NvvmArch :: Compute86 ,
258
+ "87" => NvvmArch :: Compute87 ,
259
+ "89" => NvvmArch :: Compute89 ,
260
+ "90" => NvvmArch :: Compute90 ,
261
+ "100" => NvvmArch :: Compute100 ,
258
262
_ => return Err ( "unknown arch" ) ,
259
263
} ;
260
264
Self :: Arch ( arch)
@@ -279,6 +283,11 @@ pub enum NvvmArch {
279
283
Compute72 ,
280
284
Compute75 ,
281
285
Compute80 ,
286
+ Compute86 ,
287
+ Compute87 ,
288
+ Compute89 ,
289
+ Compute90 ,
290
+ Compute100 ,
282
291
}
283
292
284
293
impl Display for NvvmArch {
@@ -403,8 +412,21 @@ impl NvvmProgram {
403
412
404
413
/// Verify the program without actually compiling it. In the case of invalid IR, you can find
405
414
/// more detailed error info by calling [`compiler_log`](Self::compiler_log).
406
- pub fn verify ( & self ) -> Result < ( ) , NvvmError > {
407
- unsafe { nvvm_sys:: nvvmVerifyProgram ( self . raw , 0 , null_mut ( ) ) . to_result ( ) }
415
+ pub fn verify ( & self , options : & [ NvvmOption ] ) -> Result < ( ) , NvvmError > {
416
+ let option_strings: Vec < _ > = options. iter ( ) . map ( |opt| opt. to_string ( ) ) . collect ( ) ;
417
+ let option_cstrings: Vec < _ > = option_strings. iter ( )
418
+ . map ( |s| std:: ffi:: CString :: new ( s. as_str ( ) ) . unwrap ( ) )
419
+ . collect ( ) ;
420
+ let mut option_ptrs: Vec < _ > = option_cstrings. iter ( )
421
+ . map ( |cs| cs. as_ptr ( ) )
422
+ . collect ( ) ;
423
+ unsafe {
424
+ nvvm_sys:: nvvmVerifyProgram (
425
+ self . raw ,
426
+ option_ptrs. len ( ) as i32 ,
427
+ option_ptrs. as_mut_ptr ( )
428
+ ) . to_result ( )
429
+ }
408
430
}
409
431
}
410
432
@@ -433,6 +455,11 @@ mod tests {
433
455
"-arch=compute_72" ,
434
456
"-arch=compute_75" ,
435
457
"-arch=compute_80" ,
458
+ "-arch=compute_86" ,
459
+ "-arch=compute_87" ,
460
+ "-arch=compute_89" ,
461
+ "-arch=compute_90" ,
462
+ "-arch=compute_100" ,
436
463
"-ftz=1" ,
437
464
"-prec-sqrt=0" ,
438
465
"-prec-div=0" ,
@@ -454,6 +481,11 @@ mod tests {
454
481
Arch ( Compute72 ) ,
455
482
Arch ( Compute75 ) ,
456
483
Arch ( Compute80 ) ,
484
+ Arch ( Compute86 ) ,
485
+ Arch ( Compute87 ) ,
486
+ Arch ( Compute89 ) ,
487
+ Arch ( Compute90 ) ,
488
+ Arch ( Compute100 ) ,
457
489
Ftz ,
458
490
FastSqrt ,
459
491
FastDiv ,
0 commit comments