From: Krzysztof Parzyszek Date: Thu, 14 May 2020 00:16:14 +0000 (-0500) Subject: [Hexagon] One more fix for concurrency count (#5589) X-Git-Tag: upstream/0.7.0~727 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc9b55768ef880ff9307bf2d3139bbf3cd2e2568;p=platform%2Fupstream%2Ftvm.git [Hexagon] One more fix for concurrency count (#5589) --- 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 #endif +#if defined(__hexagon__) +#include +#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 > max_freqs; for (unsigned int i = 0; i < threads; ++i) {