def get_cudalib(lib, platform=None): if lib == 'nvvm': return get_cuda_paths()['nvvm'].info else: libdir = get_cuda_paths()['cudalib_dir'].info candidates = find_lib(lib, libdir, platform) return max(candidates) if candidates else None
def get_cudalib(lib, platform=None): _lnvvm = get_numbapro_envvar('NUMBAPRO_NVVM') if lib == 'nvvm' and _lnvvm: return _lnvvm libdir = get_numbapro_envvar('NUMBAPRO_CUDALIB') candidates = find_lib(lib, libdir, platform) return max(candidates) if candidates else None
def test_detect(self): """ This test is solely present to ensure that shipped cudatoolkits have additional core libraries in locations that Numba scans by default. PyCulib (and potentially others) rely on Numba's library finding capacity to find and subsequently load these libraries. """ core_libs = ['nvvm', 'cublas', 'cusparse', 'cufft', 'curand'] for l in core_libs: self.assertNotEqual(find_lib(l), [])
def get_conda_ctk(): """Return path to directory containing the shared libraries of cudatoolkit. """ is_conda_env = os.path.exists(os.path.join(sys.prefix, 'conda-meta')) if not is_conda_env: return # Asssume the existence of NVVM to imply cudatoolkit installed paths = find_lib('nvvm') if not paths: return # Use the directory name of the max path return os.path.dirname(max(paths))
def get_cudalib(lib, platform=None): """ Find the path of a CUDA library based on a search of known locations. If the search fails, return a generic filename for the library (e.g. 'libnvvm.so' for 'nvvm') so that we may attempt to load it using the system loader's search mechanism. """ if lib == 'nvvm': return get_cuda_paths()['nvvm'].info or _dllnamepattern % 'nvvm' else: libdir = get_cuda_paths()['cudalib_dir'].info candidates = find_lib(lib, libdir, platform) return max(candidates) if candidates else _dllnamepattern % lib
def get_cudalib(lib, platform=None): if lib == 'nvvm' and os.environ.get('NUMBAPRO_NVVM'): return os.environ.get('NUMBAPRO_NVVM') libdir = os.environ.get('NUMBAPRO_CUDALIB') candidates = find_lib(lib, libdir, platform) return max(candidates) if candidates else None
def _get_nvvm_path(): by, path = _get_nvvm_path_decision() candidates = find_lib('nvvm', path) path = max(candidates) if candidates else None return _env_path_tuple(by, path)
def get_cudalib(lib, platform=None): libdir = os.environ.get('NUMBAPRO_CUDALIB') candidates = find_lib(lib, libdir, platform) return max(candidates) if candidates else None
def _get_nvvm_path(): by, libdir = _get_nvvm_path_decision() candidates = find_lib('nvvm', libdir) path = max(candidates) if candidates else None return _env_path_tuple(by, path)