@@ -91,11 +91,9 @@ fn compile_bindings(
9191 llama_header_path : & Path ,
9292) -> Result < ( ) , Box < dyn std:: error:: Error + ' static > > {
9393 println ! ( "Generating bindings.." ) ;
94-
95- let includes = [
96- llama_header_path. join ( "ggml" ) . join ( "include" ) ,
97- ] ;
98-
94+
95+ let includes = [ llama_header_path. join ( "ggml" ) . join ( "include" ) ] ;
96+
9997 let bindings = bindgen:: Builder :: default ( )
10098 . clang_args ( includes. map ( |path| format ! ( "-I{}" , path. to_string_lossy( ) ) ) )
10199 . header (
@@ -425,9 +423,7 @@ fn compile_cuda(cx: &mut Build, cxx: &mut Build, featless_cxx: Build) -> &'stati
425423 // nvcc.flag("-Wno-pedantic");
426424 // }
427425
428- for lib in [
429- "cuda" , "cublas" , "cudart" , "cublasLt"
430- ] {
426+ for lib in [ "cuda" , "cublas" , "cudart" , "cublasLt" ] {
431427 println ! ( "cargo:rustc-link-lib={}" , lib) ;
432428 }
433429 if !nvcc. get_compiler ( ) . is_like_msvc ( ) {
@@ -623,31 +619,44 @@ fn gen_vulkan_shaders(out_path: impl AsRef<Path>) -> (impl AsRef<Path>, impl AsR
623619 . cpp ( true )
624620 . get_compiler ( ) ;
625621
626- assert ! ( !cxx. is_like_msvc( ) , "Compiling Vulkan GGML with MSVC is not supported at this time." ) ;
622+ assert ! (
623+ !cxx. is_like_msvc( ) ,
624+ "Compiling Vulkan GGML with MSVC is not supported at this time."
625+ ) ;
627626
628627 let vulkan_shaders_gen_bin = out_path. as_ref ( ) . join ( "vulkan-shaders-gen" ) ;
629628
630629 cxx. to_command ( )
631630 . args ( [
632- vulkan_shaders_src. join ( "vulkan-shaders-gen.cpp" ) . as_os_str ( ) ,
633- "-o" . as_ref ( ) , vulkan_shaders_gen_bin. as_os_str ( )
631+ vulkan_shaders_src
632+ . join ( "vulkan-shaders-gen.cpp" )
633+ . as_os_str ( ) ,
634+ "-o" . as_ref ( ) ,
635+ vulkan_shaders_gen_bin. as_os_str ( ) ,
634636 ] )
635- . output ( ) . expect ( "Could not compile Vulkan shader generator" ) ;
637+ . output ( )
638+ . expect ( "Could not compile Vulkan shader generator" ) ;
636639
637640 let header = out_path. as_ref ( ) . join ( "ggml-vulkan-shaders.hpp" ) ;
638641 let source = out_path. as_ref ( ) . join ( "ggml-vulkan-shaders.cpp" ) ;
639642
640643 Command :: new ( vulkan_shaders_gen_bin)
641644 . args ( [
642- "--glslc" . as_ref ( ) , "glslc" . as_ref ( ) ,
643- "--input-dir" . as_ref ( ) , vulkan_shaders_src. as_os_str ( ) ,
644- "--output-dir" . as_ref ( ) , out_path. as_ref ( ) . join ( "vulkan-shaders.spv" ) . as_os_str ( ) ,
645- "--target-hpp" . as_ref ( ) , header. as_os_str ( ) ,
646- "--target-cpp" . as_ref ( ) , source. as_os_str ( ) ,
647- "--no-clean" . as_ref ( )
645+ "--glslc" . as_ref ( ) ,
646+ "glslc" . as_ref ( ) ,
647+ "--input-dir" . as_ref ( ) ,
648+ vulkan_shaders_src. as_os_str ( ) ,
649+ "--output-dir" . as_ref ( ) ,
650+ out_path. as_ref ( ) . join ( "vulkan-shaders.spv" ) . as_os_str ( ) ,
651+ "--target-hpp" . as_ref ( ) ,
652+ header. as_os_str ( ) ,
653+ "--target-cpp" . as_ref ( ) ,
654+ source. as_os_str ( ) ,
655+ "--no-clean" . as_ref ( ) ,
648656 ] )
649- . output ( ) . expect ( "Could not run Vulkan shader generator" ) ;
650-
657+ . output ( )
658+ . expect ( "Could not run Vulkan shader generator" ) ;
659+
651660 ( out_path, source)
652661}
653662
0 commit comments