nverke commented on code in PR #13181:
URL: https://github.com/apache/tvm/pull/13181#discussion_r1005066576


##########
src/runtime/hexagon/hexagon_thread_manager.cc:
##########
@@ -38,18 +38,15 @@ HexagonThreadManager::HexagonThreadManager(unsigned 
num_threads, unsigned thread
   CHECK_GE(thread_pipe_size_words, MIN_PIPE_SIZE_WORDS);
   CHECK_LE(thread_pipe_size_words, MAX_PIPE_SIZE_WORDS);
 
-  // Support either no resources or a specific set of hardware resources for 
now.
-  if (!hw_resources.empty()) {
-    CHECK((hw_resources.size() == nthreads_) && (nthreads_ == 6) && 
(hw_resources[0] == DMA_0) &&
-          (hw_resources[1] == HTP_0) && (hw_resources[2] == HVX_0) && 
(hw_resources[3] == HVX_1) &&
-          (hw_resources[4] == HVX_2) && (hw_resources[5] == HVX_3))
-        << "Unsupported hardware resource set";
-  }
   hw_resources_ = hw_resources;
+  CheckResources();
 
-  if (!hw_resources_.empty()) {
+  if (create_resource_managers_) {
     DLOG(INFO) << "Initialize hardware resource managers";
-    // Acquisition/locks will be performed on specific threads
+    // This creates the manager objects, which reserves (acquires) the 
resources.
+    // Calls to lock/unlock will be performed on threads dedicated to 
instances.
+    // This must be done before spawing threads so we can pass pointers to the

Review Comment:
   nit: spawning* 



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

Reply via email to