MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / get_native_cuda_compute_capabilities

Function get_native_cuda_compute_capabilities

configure.py:965–986  ·  view source on GitHub ↗

Get native cuda compute capabilities. Args: environ_cp: copy of the os.environ. Returns: string of native cuda compute capabilities, separated by comma.

(environ_cp)

Source from the content-addressed store, hash-verified

963
964
965def get_native_cuda_compute_capabilities(environ_cp):
966 """Get native cuda compute capabilities.
967
968 Args:
969 environ_cp: copy of the os.environ.
970
971 Returns:
972 string of native cuda compute capabilities, separated by comma.
973 """
974 device_query_bin = os.path.join(
975 environ_cp.get('CUDA_TOOLKIT_PATH'), 'extras/demo_suite/deviceQuery')
976 if os.path.isfile(device_query_bin) and os.access(device_query_bin, os.X_OK):
977 try:
978 output = run_shell(device_query_bin).split('\n')
979 pattern = re.compile('[0-9]*\\.[0-9]*')
980 output = [pattern.search(x) for x in output if 'Capability' in x]
981 output = ','.join(x.group() for x in output if x is not None)
982 except subprocess.CalledProcessError:
983 output = ''
984 else:
985 output = ''
986 return output
987
988
989def set_tf_cuda_compute_capabilities(environ_cp):

Callers 1

Calls 6

run_shellFunction · 0.85
joinMethod · 0.45
getMethod · 0.45
splitMethod · 0.45
compileMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected