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



##########
File path: src/runtime/opencl/opencl_device_api.cc
##########
@@ -72,20 +75,26 @@ void OpenCLWorkspace::GetAttr(Device dev, DeviceAttrKind 
kind, TVMRetValue* rv)
       *rv = static_cast<int64_t>(value);
       break;
     }
-    case kComputeVersion:
-      return;
-    case kDeviceName: {
-      char value[128] = {0};
-      OPENCL_CALL(
-          clGetDeviceInfo(devices[index], CL_DEVICE_NAME, sizeof(value) - 1, 
value, nullptr));
-      *rv = std::string(value);
+    case kComputeVersion: {
+      std::string ret = GetDeviceInfo(devices[index], CL_DEVICE_VERSION);
+      // String returned is "OpenCL $MAJOR.$MINOR $VENDOR_INFO".  To
+      // match other implementations, we want to return "$MAJOR.$MINOR"

Review comment:
       I'm afraid I don't quite see the breakage at this part.  For the 
OpenCLWorkspace, previously any request for kComputeVersion would return 
nullptr/None.  If there were a return value in previous versions, I'd agree 
that we'd want to avoid breaking it, but I think for a first implementation 
we're free to maintain consistency with other DeviceAPI implementations.




-- 
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