示例#1
0
def get_nvcc_version(nvcc):
    cmdline = [nvcc, "--version"]
    try:
        try:
            from pytools.prefork import call_capture_output
        except ImportError:
            from pytools.prefork import call_capture_stdout
            return call_capture_stdout(cmdline)
        else:
            retcode, stdout, stderr = call_capture_output(cmdline)
            return stdout
    except OSError, e:
        raise OSError("%s was not found (is it on the PATH?) [%s]" %
                      (nvcc, str(e)))
示例#2
0
文件: compiler.py 项目: minrk/PyCUDA
def get_nvcc_version(nvcc):
    cmdline = [nvcc, "--version"]
    try:
        try:
            from pytools.prefork import call_capture_output
        except ImportError:
            from pytools.prefork import call_capture_stdout
            return call_capture_stdout(cmdline)
        else:
            retcode, stdout, stderr = call_capture_output(cmdline)
            return stdout
    except OSError, e:
        raise OSError("%s was not found (is it on the PATH?) [%s]" 
                % (nvcc, str(e)))
示例#3
0
def get_nvcc_version(nvcc):
    cmdline = [nvcc, "--version"]
    try:
        try:
            from pytools.prefork import call_capture_output
        except ImportError:
            from pytools.prefork import call_capture_stdout
            result = call_capture_stdout(cmdline)
        else:
            retcode, stdout, stderr = call_capture_output(cmdline)
            result = stdout

        if result is None:
            from warnings import warn
            warn("NVCC version could not be determined.")
            result = "nvcc unknown version"

        return result

    except OSError, e:
        raise OSError("%s was not found (is it on the PATH?) [%s]" 
                % (nvcc, str(e)))