Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hexagon] One more fix for concurrency count #5589

Merged
merged 1 commit into from
May 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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