예제 #1
0
파일: libs.py 프로젝트: 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
예제 #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
예제 #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)
예제 #4
0
파일: cuda_paths.py 프로젝트: seibert/numba
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)
예제 #5
0
파일: libs.py 프로젝트: 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
예제 #6
0
파일: libs.py 프로젝트: 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