You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/09/06 14:53:16 UTC

[GitHub] [tvm] srkreddy1238 commented on a diff in pull request #12711: [OpenCLML] CLML Profiling fixes corresponding to OpenCL Timer recent …

srkreddy1238 commented on code in PR #12711:
URL: https://github.com/apache/tvm/pull/12711#discussion_r963810992


##########
src/runtime/contrib/clml/clml_runtime.cc:
##########
@@ -146,22 +169,7 @@ class CLMLRuntime : public JSONRuntimeBase {
       LOG(WARNING) << "CLML Runtime Init: Qualcomm extn not present.\n";
       return;
     }
-
-    // Reuse the OpenCl work space from TVM Device API.
-    auto func = tvm::runtime::Registry::Get("device_api.opencl");
-    ICHECK(func != nullptr) << "Cannot find OpenCL device_api in registry";
-    auto device_api = static_cast<cl::OpenCLWorkspace*>(((*func)()).operator void*());
-    this->context = device_api->context;
-    bool queue_found = false;
-    for (size_t i = 0; i < device_api->devices.size(); ++i) {
-      if (device_api->devices[i] == device_id) {
-        this->queue = device_api->queues[i];
-        this->evts = &(device_api->events[i]);
-        queue_found = true;
-      }
-    }
-    ICHECK(queue_found != false) << "Device queue not found in OpenCL Workspace";
-
+    this->queue = GetCommadQueue();

Review Comment:
   Both approaches leads to the same issue.
   
   ```this->queue = workspace->GetQueue(t->device);``` 
   The queue referenced here is getting recreated at https://github.com/apache/tvm/pull/11180/files#diff-783a8419915dfdfe242ef786bce4252f60f9d0decebea66d72af63d9cf9d0058R472
   
   and OpenCLML runtime is unaware of this recreation and continues to use a released command queue.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org