Esempio n. 1
0
File: libs.py Progetto: numba/numba
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
Esempio n. 2
0
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
Esempio n. 3
0
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)
Esempio n. 4
0
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)
Esempio n. 5
0
File: libs.py Progetto: ASPP/numba
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
Esempio n. 6
0
File: libs.py Progetto: zxsted/numba
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