@@ -25,11 +25,7 @@ use crate::manifest::Manifest;
2525/// or other languages without compiling the Futhark program first.
2626pub fn generate_c_header ( manifest : & Manifest , kernels : & [ KernelConfig ] ) -> Result < String > {
2727 let mut out = String :: with_capacity ( 2048 ) ;
28- let guard = manifest
29- . project
30- . name
31- . to_uppercase ( )
32- . replace ( '-' , "_" ) ;
28+ let guard = manifest. project . name . to_uppercase ( ) . replace ( '-' , "_" ) ;
3329
3430 // Header preamble.
3531 out. push_str ( & format ! (
@@ -187,10 +183,7 @@ pub fn generate_build_script(manifest: &Manifest, fut_source_path: &Path) -> Res
187183
188184 // Optional auto-tuning.
189185 if manifest. gpu . tuning {
190- out. push_str ( & format ! (
191- "echo \" Auto-tuning for backend '{}'\" \n " ,
192- backend
193- ) ) ;
186+ out. push_str ( & format ! ( "echo \" Auto-tuning for backend '{}'\" \n " , backend) ) ;
194187 out. push_str ( & format ! (
195188 "futhark autotune --backend={} {}\n \n " ,
196189 backend, source
@@ -245,9 +238,12 @@ mod tests {
245238 #[ test]
246239 fn test_c_header_structure ( ) {
247240 let manifest = test_manifest ( ) ;
248- let kernels = vec ! [
249- make_kernel( "blur" , SOAC :: Map , FutharkType :: F32 , FutharkType :: F32 ) ,
250- ] ;
241+ let kernels = vec ! [ make_kernel(
242+ "blur" ,
243+ SOAC :: Map ,
244+ FutharkType :: F32 ,
245+ FutharkType :: F32 ,
246+ ) ] ;
251247 let header = generate_c_header ( & manifest, & kernels) . unwrap ( ) ;
252248 assert ! ( header. contains( "#ifndef TEST_PROJECT_H" ) ) ;
253249 assert ! ( header. contains( "#define TEST_PROJECT_H" ) ) ;
@@ -277,8 +273,7 @@ mod tests {
277273 #[ test]
278274 fn test_build_script_contains_backend ( ) {
279275 let manifest = test_manifest ( ) ;
280- let script =
281- generate_build_script ( & manifest, Path :: new ( "test-project.fut" ) ) . unwrap ( ) ;
276+ let script = generate_build_script ( & manifest, Path :: new ( "test-project.fut" ) ) . unwrap ( ) ;
282277 assert ! ( script. contains( "futhark opencl test-project.fut" ) ) ;
283278 assert ! ( !script. contains( "autotune" ) ) ;
284279 }
@@ -287,16 +282,14 @@ mod tests {
287282 fn test_build_script_with_tuning ( ) {
288283 let mut manifest = test_manifest ( ) ;
289284 manifest. gpu . tuning = true ;
290- let script =
291- generate_build_script ( & manifest, Path :: new ( "test-project.fut" ) ) . unwrap ( ) ;
285+ let script = generate_build_script ( & manifest, Path :: new ( "test-project.fut" ) ) . unwrap ( ) ;
292286 assert ! ( script. contains( "futhark autotune" ) ) ;
293287 }
294288
295289 #[ test]
296290 fn test_build_script_checks_futhark_installed ( ) {
297291 let manifest = test_manifest ( ) ;
298- let script =
299- generate_build_script ( & manifest, Path :: new ( "test.fut" ) ) . unwrap ( ) ;
292+ let script = generate_build_script ( & manifest, Path :: new ( "test.fut" ) ) . unwrap ( ) ;
300293 assert ! ( script. contains( "command -v futhark" ) ) ;
301294 }
302295}
0 commit comments