Ejemplo n.º 1
0
def is_supported_version():
    """Returns True if the CUDA Runtime is a supported version.

    Unsupported versions (e.g. newer versions than those known to Numba)
    may still work; this function provides a facility to check whether the
    current Numba version is tested and known to work with the current
    runtime version. If the current version is unsupported, the caller can
    decide how to act. Options include:

    - Continuing silently,
    - Emitting a warning,
    - Generating an error or otherwise preventing the use of CUDA.
    """

    return runtime.is_supported_version()
Ejemplo n.º 2
0
 def test_is_supported_version_false(self):
     # Check with an old unsupported version and some potential future
     # versions
     for v in ((8, 0), (11, 3), (12, 0)):
         with patch.object(runtime, 'get_version', return_value=v):
             self.assertFalse(runtime.is_supported_version())
Ejemplo n.º 3
0
 def test_is_supported_version_true(self):
     for v in SUPPORTED_VERSIONS:
         with patch.object(runtime, 'get_version', return_value=v):
             self.assertTrue(runtime.is_supported_version())