1414from .base import DependencyException , SystemDependency
1515from .detect import packages
1616from ..mesonlib import LibType
17+ from ..interpreterbase import FeatureNew
1718
1819if T .TYPE_CHECKING :
1920 from ..environment import Environment
@@ -40,7 +41,10 @@ def __init__(self, environment: 'Environment', kwargs: DependencyObjectKWs) -> N
4041 super ().__init__ ('cuda' , environment , kwargs , language = language )
4142 self .lib_modules : T .Dict [str , T .List [str ]] = {}
4243 self .requested_modules = kwargs .get ('modules' , [])
43- if not any (runtime in self .requested_modules for runtime in ['cudart' , 'cudart_static' ]):
44+ if 'cudart_none' in self .requested_modules :
45+ self .featurechecks .append (FeatureNew ('Cuda module cudart_none' , '1.10' ))
46+
47+ if not any (runtime in self .requested_modules for runtime in ['cudart' , 'cudart_static' , 'cudart_none' ]):
4448 # By default, we prefer to link the static CUDA runtime, since this is what nvcc also does by default:
4549 # https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#cudart-none-shared-static-cudart
4650 req_modules = ['cudart' ]
@@ -273,6 +277,10 @@ def _find_requested_libraries(self) -> bool:
273277 all_found = True
274278
275279 for module in self .requested_modules :
280+ if module == 'cudart_none' :
281+ self .lib_modules [module ] = []
282+ continue
283+
276284 # You should only ever link to libraries inside the cuda tree, nothing outside of it.
277285 # For instance, there is a
278286 #
@@ -319,6 +327,7 @@ def get_link_args(self, language: T.Optional[str] = None, raw: bool = False) ->
319327 REWRITE_MODULES = {
320328 'cudart' : ['-cudart' , 'shared' ],
321329 'cudart_static' : ['-cudart' , 'static' ],
330+ 'cudart_none' : ['-cudart' , 'none' ],
322331 'cudadevrt' : ['-cudadevrt' ],
323332 }
324333
0 commit comments