Make cudnn.h version detection more robust in find_cuda_config.py.
This change allows the script to properly parse version specifications like: #define CUDNN_MAJOR 7 #define CUDNN_MINOR 0 #define CUDNN_PATCHLEVEL 2 PiperOrigin-RevId: 245273662
This commit is contained in:
parent
ccd35296e8
commit
221d18167e
2
third_party/gpus/find_cuda_config.py
vendored
2
third_party/gpus/find_cuda_config.py
vendored
@ -116,7 +116,7 @@ def _at_least_version(actual_version, required_version):
|
||||
def _get_header_version(path, name):
|
||||
"""Returns preprocessor defines in C header file."""
|
||||
for line in open(path, "r").readlines():
|
||||
match = re.match("#define %s (\d+)" % name, line)
|
||||
match = re.match("#define %s +(\d+)" % name, line)
|
||||
if match:
|
||||
return match.group(1)
|
||||
return ""
|
||||
|
Loading…
Reference in New Issue
Block a user