MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / check_cuda_versions

Function check_cuda_versions

python/cutlass_cppgen/__init__.py:166–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

164this._nvcc_version = None
165
166def check_cuda_versions():
167 # Strip any additional information from the CUDA version
168 _cuda_version = base_cuda.__version__.split("rc")[0]
169 # Check that Python CUDA version exceeds NVCC version
170 this._nvcc_version = nvcc_version()
171 _cuda_list = _cuda_version.split('.')
172 _nvcc_list = this._nvcc_version.split('.')
173 for val_cuda, val_nvcc in zip(_cuda_list, _nvcc_list):
174 if int(val_cuda) < int(val_nvcc):
175 raise Exception(f"Python CUDA version of {_cuda_version} must be greater than or equal to NVCC version of {this._nvcc_version}")
176
177 if len(_nvcc_list) > len(_cuda_list):
178 if len(_nvcc_list) != len(_cuda_list) + 1:
179 raise Exception(f"Malformatted NVCC version of {this._nvcc_version}")
180 if _nvcc_list[:-1] == _cuda_list and int(_nvcc_list[-1]) != 0:
181 raise Exception(f"Python CUDA version of {_cuda_version} must be greater than or equal to NVCC version of {this._nvcc_version}")
182
183def initialize_cuda_context():
184 check_cuda_versions()

Callers 1

initialize_cuda_contextFunction · 0.85

Calls 2

nvcc_versionFunction · 0.85
zipFunction · 0.50

Tested by

no test coverage detected