예제 #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
 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