def _get_source_variable(lib): if lib == 'nvvm': return get_cuda_paths()['nvvm'].by elif lib == 'libdevice': return get_cuda_paths()['libdevice'].by else: return get_cuda_paths()['cudalib_dir'].by
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): """ 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_libdevice(arch): d = get_cuda_paths() paths = d['libdevice'].info return paths.get(arch, paths.get(None))
def get_libdevice(): d = get_cuda_paths() paths = d['libdevice'].info return paths