@@ -4,7 +4,6 @@ use std::{
44 ffi:: { CStr , CString } ,
55 fmt:: Display ,
66 mem:: MaybeUninit ,
7- ptr:: null_mut,
87 str:: FromStr ,
98} ;
109
@@ -255,6 +254,11 @@ impl FromStr for NvvmOption {
255254 "72" => NvvmArch :: Compute72 ,
256255 "75" => NvvmArch :: Compute75 ,
257256 "80" => NvvmArch :: Compute80 ,
257+ "86" => NvvmArch :: Compute86 ,
258+ "87" => NvvmArch :: Compute87 ,
259+ "89" => NvvmArch :: Compute89 ,
260+ "90" => NvvmArch :: Compute90 ,
261+ "100" => NvvmArch :: Compute100 ,
258262 _ => return Err ( "unknown arch" ) ,
259263 } ;
260264 Self :: Arch ( arch)
@@ -279,6 +283,11 @@ pub enum NvvmArch {
279283 Compute72 ,
280284 Compute75 ,
281285 Compute80 ,
286+ Compute86 ,
287+ Compute87 ,
288+ Compute89 ,
289+ Compute90 ,
290+ Compute100 ,
282291}
283292
284293impl Display for NvvmArch {
@@ -403,8 +412,21 @@ impl NvvmProgram {
403412
404413 /// Verify the program without actually compiling it. In the case of invalid IR, you can find
405414 /// 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+ }
408430 }
409431}
410432
@@ -433,6 +455,11 @@ mod tests {
433455 "-arch=compute_72" ,
434456 "-arch=compute_75" ,
435457 "-arch=compute_80" ,
458+ "-arch=compute_86" ,
459+ "-arch=compute_87" ,
460+ "-arch=compute_89" ,
461+ "-arch=compute_90" ,
462+ "-arch=compute_100" ,
436463 "-ftz=1" ,
437464 "-prec-sqrt=0" ,
438465 "-prec-div=0" ,
@@ -454,6 +481,11 @@ mod tests {
454481 Arch ( Compute72 ) ,
455482 Arch ( Compute75 ) ,
456483 Arch ( Compute80 ) ,
484+ Arch ( Compute86 ) ,
485+ Arch ( Compute87 ) ,
486+ Arch ( Compute89 ) ,
487+ Arch ( Compute90 ) ,
488+ Arch ( Compute100 ) ,
457489 Ftz ,
458490 FastSqrt ,
459491 FastDiv ,
0 commit comments