Exemplo n.º 1
0
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
Exemplo n.º 2
0
Arquivo: libs.py Projeto: numba/numba
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
Exemplo n.º 3
0
 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), [])
Exemplo n.º 4
0
 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), [])
Exemplo n.º 5
0
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))
Exemplo n.º 6
0
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))
Exemplo n.º 7
0
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
Exemplo n.º 8
0
Arquivo: libs.py Projeto: ASPP/numba
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
Exemplo n.º 9
0
Arquivo: libs.py Projeto: zxsted/numba
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
Exemplo n.º 10
0
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)
Exemplo n.º 11
0
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
Exemplo n.º 12
0
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)
Exemplo n.º 13
0
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