cconvey commented on code in PR #13177:
URL: https://github.com/apache/tvm/pull/13177#discussion_r1009828664
##########
python/tvm/_ffi/runtime_ctypes.py:
##########
@@ -195,44 +195,73 @@ class Device(ctypes.Structure):
OpenCL. Some properties may return None depending on whether an
API exposes that particular property.
+ NOTE! The integer values in MASK2STR and STR2MASK *must* correspond
+ to the values provided by the DLDeviceType and TVMDeviceExtType enums.
"""
+ kDLCPU = 1
+ kDLCUDA = 2
+ kDLCUDAHost = 3
+ kDLOpenCL = 4
+ kDLVulkan = 7
+ kDLMetal = 8
+ kDLVPI = 9
+ kDLROCM = 10
+ kDLROCMHost = 11
+ kDLExtDev = 12
+ kDLCUDAManaged = 13
+ kDLOneAPI = 14
+ kDLWebGPU = 15
+ kDLHexagon = 16
+ kDLAOCL = 32
+ kDLSDAccel = 33
+ kOpenGL = 34
+ kDLMicroDev = 35
+
Review Comment:
> Is there a way for us to initialize these from there corresponding
DLDeviceType and TVMDeviceExtType enums potentially via a packed function call?
I definitely considered that idea. The main goal of the PR is to upgrade
DLPack, and I felt a significant reworking of how these constants are handled
belonged in a separate PR.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]