@@ -4,12 +4,13 @@ use std::path::{Path, PathBuf};
44pub fn get_cuda_path ( ) -> Option < & ' static Path > {
55 #[ cfg( target_os = "linux" ) ]
66 {
7- for path_name in [ option_env ! ( "CUDA_PATH" ) , Some ( "/usr/local/cuda" ) ] . iter ( ) . flatten ( ) {
8- println ! ( "trying {path_name}..." ) ;
7+ for path_name in [ option_env ! ( "CUDA_PATH" ) , Some ( "/usr/local/cuda" ) ]
8+ . iter ( )
9+ . flatten ( )
10+ {
911 let path = Path :: new ( path_name) ;
1012 if path. exists ( ) {
11- println ! ( "CUDA installation found at `{}`" , path. display( ) ) ;
12- return Some ( path)
13+ return Some ( path) ;
1314 }
1415 }
1516 None
@@ -45,10 +46,8 @@ pub fn get_cuda_lib_path() -> Option<PathBuf> {
4546
4647pub fn get_cuda_version ( ) -> Option < String > {
4748 if let Some ( version) = option_env ! ( "CUDA_VERSION" ) {
48- println ! ( "CUDA version defined in CUDA_VERSION as `{}`" , version) ;
4949 Some ( version. to_string ( ) )
5050 } else if let Some ( path) = get_cuda_path ( ) {
51- println ! ( "inferring CUDA version from nvcc output..." ) ;
5251 let re = regex_lite:: Regex :: new ( r"V(?<version>\d{2}\.\d+\.\d+)" ) . unwrap ( ) ;
5352 let nvcc_out = std:: process:: Command :: new ( "nvcc" )
5453 . arg ( "--version" )
@@ -61,7 +60,6 @@ pub fn get_cuda_version() -> Option<String> {
6160 . expect ( "unable to find nvcc version in the form VMM.mm.pp in the output of `nvcc --version`:\n {nvcc_str}" )
6261 . as_str ( )
6362 . to_string ( ) ;
64- println ! ( "CUDA version inferred to be `{version}`." ) ;
6563 Some ( version)
6664 } else {
6765 None
0 commit comments