This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
     new dc9b557  [Hexagon] One more fix for concurrency count (#5589)
dc9b557 is described below

commit dc9b55768ef880ff9307bf2d3139bbf3cd2e2568
Author: Krzysztof Parzyszek <[email protected]>
AuthorDate: Wed May 13 19:16:14 2020 -0500

    [Hexagon] One more fix for concurrency count (#5589)
---
 src/runtime/threading_backend.cc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/runtime/threading_backend.cc b/src/runtime/threading_backend.cc
index 2e781ea..e5520ef 100644
--- a/src/runtime/threading_backend.cc
+++ b/src/runtime/threading_backend.cc
@@ -34,6 +34,9 @@
 #if defined(__linux__)
 #include <sched.h>
 #endif
+#if defined(__hexagon__)
+#include <dlfcn.h>
+#endif
 
 namespace tvm {
 namespace runtime {
@@ -177,6 +180,11 @@ class ThreadGroup::Impl {
 
   void InitSortedOrder() {
     unsigned int threads = std::thread::hardware_concurrency();
+#if defined(__hexagon__)
+    // With unsigned PDs, getting the number of available hardware threads
+    // is not supported in earlier versions of QuRT. In such cases assume 4.
+    if (threads == 0) threads = 4;
+#endif
     std::vector<std::pair<unsigned int, int64_t> > max_freqs;
 
     for (unsigned int i = 0; i < threads; ++i) {

Reply via email to