コード例 #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
コード例 #2
0
ファイル: libs.py プロジェクト: 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
コード例 #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), [])
コード例 #4
0
ファイル: test_cuda_libraries.py プロジェクト: seibert/numba
 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), [])
コード例 #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))
コード例 #6
0
ファイル: cuda_paths.py プロジェクト: seibert/numba
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))
コード例 #7
0
ファイル: libs.py プロジェクト: toddrme2178/numba
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
コード例 #8
0
ファイル: libs.py プロジェクト: 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
コード例 #9
0
ファイル: libs.py プロジェクト: 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
コード例 #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)
コード例 #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
コード例 #12
0
ファイル: cuda_paths.py プロジェクト: seibert/numba
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)
コード例 #13
0
ファイル: libs.py プロジェクト: MJJoyce/numba
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