MCPcopy Create free account
hub / github.com/apache/tvm / parse_compute_version

Function parse_compute_version

python/tvm/support/nvcc.py:1011–1033  ·  view source on GitHub ↗

Parse compute capability string to divide major and minor version Parameters ---------- compute_version : str compute capability of a GPU (e.g. "6.0") Returns ------- major : int major version number minor : int minor version number

(compute_version)

Source from the content-addressed store, hash-verified

1009
1010
1011def parse_compute_version(compute_version):
1012 """Parse compute capability string to divide major and minor version
1013
1014 Parameters
1015 ----------
1016 compute_version : str
1017 compute capability of a GPU (e.g. "6.0")
1018
1019 Returns
1020 -------
1021 major : int
1022 major version number
1023 minor : int
1024 minor version number
1025 """
1026 split_ver = compute_version.split(".")
1027 try:
1028 major = int(split_ver[0])
1029 minor = int(split_ver[1])
1030 return major, minor
1031 except (IndexError, ValueError) as err:
1032 # pylint: disable=raise-missing-from
1033 raise RuntimeError("Compute version parsing error: " + str(err))
1034
1035
1036def have_fp16(compute_version):

Callers 7

_compile_cuda_nvccFunction · 0.70
have_fp16Function · 0.70
have_int8Function · 0.70
have_tensorcoreFunction · 0.70
have_bf16Function · 0.70
have_fp8Function · 0.70
have_fp4Function · 0.70

Calls 2

strFunction · 0.85
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…