Skip to content

Commit

Permalink
[Hexagon] One more fix for concurrency count (apache#5589)
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Parzyszek authored and trevor-m committed Jun 18, 2020
1 parent 5caf0fd commit 9c26a05
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/runtime/threading_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
#if defined(__linux__)
#include <sched.h>
#endif
#if defined(__hexagon__)
#include <dlfcn.h>
#endif

namespace tvm {
namespace runtime {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 9c26a05

Please sign in to comment.