def get_libdevice(arch): libdir = (get_numbapro_envvar('NUMBAPRO_LIBDEVICE') or get_numbapro_envvar('NUMBAPRO_CUDALIB')) pat = r'libdevice\.%s(\.\d+)*\.bc$' % arch candidates = find_file(re.compile(pat), libdir) if not candidates: # CUDA 9 switches to fat library, with no arch in name pat = r'libdevice(\.\d+)*\.bc$' candidates = find_file(re.compile(pat), libdir) return max(candidates) if candidates else None
def get_libdevice(arch): libdir = (os.environ.get('NUMBAPRO_LIBDEVICE') or os.environ.get('NUMBAPRO_CUDALIB')) pat = r'libdevice\.%s(\.\d+)*\.bc$' % arch candidates = find_file(re.compile(pat), libdir) if not candidates: # CUDA 9 switches to fat library, with no arch in name pat = r'libdevice(\.\d+)*\.bc$' candidates = find_file(re.compile(pat), libdir) return max(candidates) if candidates else None
def _get_libdevice_paths(): by, libdir = _get_libdevice_path_decision() # Search for pattern pat = r'libdevice(\.(?P<arch>compute_\d+))?(\.\d+)*\.bc$' candidates = find_file(re.compile(pat), libdir) # Grouping out = defaultdict(list) for path in candidates: m = re.search(pat, path) arch = m.group('arch') out[arch].append(path) # Keep only the max (most recent version) of the bitcode files. out = {k: max(v) for k, v in out.items()} return _env_path_tuple(by, out)
def get_libdevice(arch): libdir = (os.environ.get('NUMBAPRO_LIBDEVICE') or os.environ.get('NUMBAPRO_CUDALIB')) pat = r'libdevice\.%s(\.\d+)*\.bc$' % arch candidates = find_file(re.compile(pat), libdir) return max(candidates) if candidates else None