You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ju...@apache.org on 2022/07/14 17:07:19 UTC

[tvm] branch main updated: [WIN] export void Configure(...) symbol for Windows (#12091)

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

junrushao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new de3c0f4b30 [WIN] export void Configure(...) symbol for Windows (#12091)
de3c0f4b30 is described below

commit de3c0f4b30b33eb54e851f94d518ca3349423cfa
Author: Valery Chernov <bl...@gmail.com>
AuthorDate: Thu Jul 14 20:07:10 2022 +0300

    [WIN] export void Configure(...) symbol for Windows (#12091)
    
    Extends TVM API for clients of Windows. It helps configure thread pool on native side on Windows OS.
    
    Co-authored-by: Valery Chernov <va...@deelvin.com>
---
 include/tvm/runtime/threading_backend.h | 4 ++--
 src/runtime/thread_pool.cc              | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/tvm/runtime/threading_backend.h b/include/tvm/runtime/threading_backend.h
index c23ba835fc..77d6730c09 100644
--- a/include/tvm/runtime/threading_backend.h
+++ b/include/tvm/runtime/threading_backend.h
@@ -137,8 +137,8 @@ void ResetThreadPool();
  * \param nthreads The number of threads to use (0 = use all).
  * \param cpus A list of CPUs is used to set the 'cpu affinity' for the worker threads.
  */
-void Configure(tvm::runtime::threading::ThreadGroup::AffinityMode mode, int nthreads,
-               std::vector<unsigned int> cpus);
+TVM_DLL void Configure(tvm::runtime::threading::ThreadGroup::AffinityMode mode, int nthreads,
+                       std::vector<unsigned int> cpus);
 
 /*!
  * \brief Get the number of threads being used by the TVM runtime
diff --git a/src/runtime/thread_pool.cc b/src/runtime/thread_pool.cc
index 4692e06734..6dc87cda11 100644
--- a/src/runtime/thread_pool.cc
+++ b/src/runtime/thread_pool.cc
@@ -458,8 +458,8 @@ void ResetThreadPool() { tvm::runtime::ThreadPool::ThreadLocal()->Reset(); }
  * \param cpus cpus A list of CPUs is used to set the 'cpu affinity' for the worker threads.
  *
  */
-void Configure(tvm::runtime::threading::ThreadGroup::AffinityMode mode, int nthreads,
-               std::vector<unsigned int> cpus) {
+TVM_DLL void Configure(tvm::runtime::threading::ThreadGroup::AffinityMode mode, int nthreads,
+                       std::vector<unsigned int> cpus) {
   tvm::runtime::threading::SetMaxConcurrency(cpus.size());
 #if !TVM_THREADPOOL_USE_OPENMP
   tvm::runtime::ThreadPool::ThreadLocal()->UpdateWorkerConfiguration(mode, nthreads, cpus);