Lunderberg commented on a change in pull request #7867:
URL: https://github.com/apache/tvm/pull/7867#discussion_r616184276



##########
File path: python/tvm/_ffi/runtime_ctypes.py
##########
@@ -262,6 +264,35 @@ def max_thread_dimensions(self):
         """
         return json.loads(self._GetDeviceAttr(self.device_type, 
self.device_id, 8))
 
+    @property
+    def api_version(self):
+        """Returns version number of the SDK used to compile TVM.
+
+        For example, CUDA_VERSION for cuda or VK_HEADER_VERSION for
+        Vulkan.
+
+        Returns
+        -------
+        version : int
+            The version of the SDK
+
+        """
+        return self._GetDeviceAttr(self.device_type, self.device_id, 12)
+
+    @property
+    def driver_version(self):
+        """Returns version number of the driver
+
+        Returns driver vendor's internal version number.
+        (e.g. "450.408.256" for nvidia-driver-450)
+
+        Returns
+        -------
+        version : str

Review comment:
       Good point, I had been thinking of implemented in C++ virtual functions 
terms.  I'll update the docstrings to instead read "Returns device value for X, 
Y, and Z devices.  Returns None for any other devices."




-- 
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:
us...@infra.apache.org


Reply via email to