mbs-octoml commented on a change in pull request #9077:
URL: https://github.com/apache/tvm/pull/9077#discussion_r715041704
##########
File path: include/tvm/runtime/ndarray.h
##########
@@ -38,9 +38,19 @@
#include <vector>
namespace tvm {
-namespace runtime {
-typedef DLDevice Device;
+// alias DLDevice
+using Device = DLDevice;
+
+// A 'null' device type, does not correspond to any DLDeviceType enum.
+// TODO(mbs): This is to help us as we transition away from representing the
'homogenous' case
+// as a singleton target map indexed by the invalid DLDeviceType '0'.
+constexpr DLDeviceType kNullDeviceType = static_cast<DLDeviceType>(0);
+
+// An 'invalid' device type, does not correspond to any DLDeviceType enum.
Review comment:
I don't know. Note that these special values are endemic in the code
(often stored in naked ints) so I'm at least not introducing a new convention.
I think the argument for this approach is the enum values should always be
valid at runtime and these invalid-but-distinguished values are just a compile
time concept.
I this as a stepping stone to planning with hybrid targets/devices rather
than just device or device types, in which case these distinguished values can
go away.
--
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]