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:
Skye Wanderman-Milne 2019-04-25 11:25:13 -07:00 committed by TensorFlower Gardener
parent ccd35296e8
commit 221d18167e

View File

@ -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 ""