masahi commented on a change in pull request #8216:
URL: https://github.com/apache/tvm/pull/8216#discussion_r647909253



##########
File path: python/tvm/contrib/rocm.py
##########
@@ -168,3 +168,34 @@ def callback_rocm_bitcode_path(rocdl_dir=None):
             raise RuntimeError("could not find bitcode " + n)
 
     return tvm.runtime.convert(bitcode_files)
+
+
+def parse_compute_version(compute_version):
+    """Parse compute capability string to divide major and minor version
+
+    Parameters
+    ----------
+    compute_version : str
+        GFX version of a GPU (e.g. "6.0")
+
+    Returns
+    -------
+    major : int
+        major version number
+    minor : int
+        minor version number
+    """
+    split_ver = compute_version.split(".")
+    try:
+        major = int(split_ver[0])
+        minor = int(split_ver[1])
+        return major, minor
+    except (IndexError, ValueError) as err:
+        raise RuntimeError("Compute version parsing error: " + str(err))
+
+
+def support_mfma(device):
+    major, minor = parse_compute_version(device.compute_version)
+    if major >= 9 and minor >= 8:

Review comment:
       Since probably mfma is only available on gfx908, how about directly 
comparing against "908"? Newer arch like navi2 is gfx1030 but it does not have 
mfma.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to