@@ -1194,55 +1194,43 @@ mod tests {
11941194 assert_eq ! ( compute80_variants, vec![ NvvmArch :: Compute80 ] ) ;
11951195
11961196 // Architecture with architecture and base variants
1197- let mut compute90_variants = NvvmArch :: Compute90 . get_variants ( ) ;
1198- compute90_variants. sort_by_key ( |v| format ! ( "{:?}" , v) ) ;
11991197 assert_eq ! (
1200- compute90_variants ,
1198+ NvvmArch :: Compute90 . get_variants ( ) ,
12011199 vec![ NvvmArch :: Compute90 , NvvmArch :: Compute90a ]
12021200 ) ;
12031201
12041202 // Architecture with all three variants
1205- let mut compute120_variants = NvvmArch :: Compute120 . get_variants ( ) ;
1206- compute120_variants. sort_by_key ( |v| format ! ( "{:?}" , v) ) ;
1207- assert_eq ! (
1208- compute120_variants,
1209- vec![
1210- NvvmArch :: Compute120 ,
1211- NvvmArch :: Compute120a ,
1212- NvvmArch :: Compute120f
1213- ]
1214- ) ;
1215-
1216- // Getting variants from a variant returns all variants
1217- let compute120f_variants = NvvmArch :: Compute120f . get_variants ( ) ;
1218- assert_eq ! ( compute120f_variants. len( ) , 3 ) ;
1219- assert ! ( compute120f_variants. contains( & NvvmArch :: Compute120 ) ) ;
1220- assert ! ( compute120f_variants. contains( & NvvmArch :: Compute120f ) ) ;
1221- assert ! ( compute120f_variants. contains( & NvvmArch :: Compute120a ) ) ;
1203+ let expected120 = vec ! [
1204+ NvvmArch :: Compute120 ,
1205+ NvvmArch :: Compute120f ,
1206+ NvvmArch :: Compute120a ,
1207+ ] ;
1208+ assert_eq ! ( NvvmArch :: Compute120 . get_variants( ) , expected120) ;
1209+ assert_eq ! ( NvvmArch :: Compute120f . get_variants( ) , expected120) ;
1210+ assert_eq ! ( NvvmArch :: Compute120a . get_variants( ) , expected120) ;
12221211 }
12231212
12241213 #[ test]
12251214 fn nvvm_arch_variants_for_capability ( ) {
12261215 use crate :: NvvmArch ;
12271216
12281217 // Capability with single variant
1229- let compute75_variants = NvvmArch :: variants_for_capability ( 75 ) ;
1230- assert_eq ! ( compute75_variants, vec![ NvvmArch :: Compute75 ] ) ;
1218+ assert_eq ! (
1219+ NvvmArch :: variants_for_capability( 75 ) ,
1220+ vec![ NvvmArch :: Compute75 ]
1221+ ) ;
12311222
12321223 // Capability with multiple variants
1233- let mut compute101_variants = NvvmArch :: variants_for_capability ( 101 ) ;
1234- compute101_variants. sort_by_key ( |v| format ! ( "{:?}" , v) ) ;
12351224 assert_eq ! (
1236- compute101_variants ,
1225+ NvvmArch :: variants_for_capability ( 101 ) ,
12371226 vec![
12381227 NvvmArch :: Compute101 ,
1228+ NvvmArch :: Compute101f ,
12391229 NvvmArch :: Compute101a ,
1240- NvvmArch :: Compute101f
12411230 ]
12421231 ) ;
12431232
12441233 // Non-existent capability
1245- let compute999_variants = NvvmArch :: variants_for_capability ( 999 ) ;
1246- assert ! ( compute999_variants. is_empty( ) ) ;
1234+ assert ! ( NvvmArch :: variants_for_capability( 999 ) . is_empty( ) ) ;
12471235 }
12481236}
0 commit comments