Exemplo n.º 1
0
def test_assumed_runtime_version():
    # When CUDA Python is enabled, CuPy calculates the CUDA runtime version
    # from NVRTC version. This test ensures that the assumption is correct
    # by running the same logic in non-CUDA Python environment.
    # When this fails, `runtime.runtimeGetVersion()` logic needs to be fixed.
    (major, minor) = nvrtc.getVersion()
    assert runtime.runtimeGetVersion() == major * 1000 + minor * 10
Exemplo n.º 2
0
def _get_nvrtc_version():
    global _nvrtc_version
    if _nvrtc_version is None:
        _nvrtc_version = nvrtc.getVersion()

    return _nvrtc_version