File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1010
1111from numba .cuda .cudadrv .nvrtc import _get_nvrtc_version
1212
13+ SUPPORTED_TOOLKIT_MAJOR_VERSIONS = (12 , 13 )
14+
1315
1416class Runtime :
1517 def get_version (self ):
1618 return _get_nvrtc_version ()
1719
20+ def is_supported_version (self ):
21+ """
22+ Returns True if the CUDA Runtime is a supported version.
23+ """
24+ return self .get_version ()[0 ] in SUPPORTED_TOOLKIT_MAJOR_VERSIONS
25+
1826
1927runtime = Runtime ()
2028
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ def is_supported_version():
133133 - Generating an error or otherwise preventing the use of CUDA.
134134 """
135135
136- return runtime .get_version ()[ 0 ] in ( 12 , 13 )
136+ return runtime .is_supported_version ( )
137137
138138
139139def cuda_error ():
You can’t perform that action at this time.
0 commit comments